I plan to write a gem that create a zip file by download from a link or get from filesystem or from a string and upload to s3. Is it a good idea I hijack the Zip module from rubyzip?
Zip::Voidzip.upload! do |zip|
zip.add "http://example.com/example.png", :as => "image/zzz.png"
zip.add "asdasdasdads"
zip.add "asd/asd.png"
end
Since the code most probabily will be like this.
module Zip
class Voidzip
def initialize zipname
t = Tempfile.new(zipname)
ZipOutputStream.open(t.path) do |zos|
end
end
end
end
Any suggestion for newbie that want to contribute?
Best practice is to name your gem
voidzip.If you are intending your gem to be a plugin for
zip, and ifzipactually supports a plugin architecture, then practice would be to name your gemzip-voidzip(but I don’t think that’s the case here).Your module/namespace structure should mirror your gem’s name.
If your gem is named
voidzip, then I expect all of your code to be withinVoidzipand I expect to be able torequire "voidzip".If your gem is named
zip-voidzip, then I expect all of your code to be withinZip::Voidzipand I expect to be able torequire "zip-voidzip"orrequire "zip/voidzip"at my choice.