$ rake encode['Madonna na nohy do o']
Last active
December 14, 2015 01:19
-
-
Save roolo/5005600 to your computer and use it in GitHub Desktop.
Barby usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'barby' | |
require 'barby/barcode/qr_code' | |
require 'barby/outputter/png_outputter' | |
desc 'Encodes text into QR Code' | |
task :encode, [:text] do |t, args| | |
barcode = Barby::QrCode.new(args[:text]) | |
outputter = Barby::PngOutputter.new(barcode) | |
File.open('barcode.png', 'w'){|f| f.write outputter.to_png } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment