toretore / barby

The Ruby barcode generator
http://toretore.github.com/barby/
MIT License
844 stars 169 forks source link

add dependency chunk_png #100

Closed 4geru closed 4 years ago

4geru commented 4 years ago

Background

I run the sample code and caused error. Error tells to me add chunky_png. So add chunky_png gems as dependency.

sample

require 'barby'
require 'barby/barcode/code_128'
require 'barby/outputter/png_outputter'

barcode = Barby::Code128.new('sample')
File.open('code128.png', 'w'){|f|
  f.write barcode.to_png(:height => 20, :margin => 5)
}

error code

 → bundle exec ruby sample.rb
/project/to/path/vendor/bundle/gems/barby-0.6.8/lib/barby/outputter/png_outputter.rb:2:in `require': cannot load such file -- chunky_png (LoadError)
        from /Users/4geru/train/qr-coders/vendor/bundle/gems/barby-0.6.8/lib/barby/outputter/png_outputter.rb:2:in `<top (required)>'
        from sample.rb:3:in `require'
        from sample.rb:3:in `<main>'
toretore commented 4 years ago

The dependencies are left out on purpose, because otherwise you'd have to install all of them even if you only need one.

4geru commented 4 years ago

Thanks for your review. 😄 I know your comment and understand why chunky_png is not defined.

But chunky_png is required in barby. Dependey is happened, so it is need to support as this gem.

4geru commented 4 years ago

I watched readme and understand.

ref: https://github.com/toretore/barby#outputters