A simple mrbgem to generate QR Codes.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 4 commits ahead, 3 commits behind sadasant:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
include/mruby/ext
mrblib
qrcode @ 8667164
src
test
.gitignore
.gitmodules
LICENSE
README.mkd
mrbgem.rake
run_test.rb

README.mkd

mruby-qrcode

A simple mrbgem to generate QR Codes.

Example

Initialize the object with contents you want in the QR code qr = QR.new("Hello world!"), later you'll be able to change these contents by changing the value of qr.msg. To generate the bytecodes of the QR code, simply call qr.generate()("bmp" as default format and 3 as default magnify), it will return a string buffer which you can use to write the QR code file.

qr  = QR.new("Hello world!")
buf = qr.generate("bmp", 3)
File.open("qrcode_hello_world.bmp", 'w') { |file| file.write(buf) }

The example above will generate the following QR code:

NOTE: By default, the filetype is BMP, you can change this by sending the file format to the generate method, the available formats are: PNG, BMP, TIFF, PBM, SVG, JSON, DIGIT and ASCII.

TEST

Run the tests with:

./run_test.rb test

LICENSE

Check the LICENSE file.