Skip to content

scalone/mruby-qrcode

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 4 commits ahead, 3 commits behind sadasant:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

A simple mrbgem to generate QR Codes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 67.1%
  • C 32.9%