Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The Ruby barcode generator

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 pkg
Octocat-spinner-32 site
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
README
Barby is a Ruby barcode generator. It does not depend on other libraries
(for the core functionality) and is easily extentable.

The barcode objects are separated from the process of generating graphical
(or other) representations. A barcode's only responsibility is to provide
a string representation consisting of 1s and 0s representing bars and spaces.
This string can then be used to generate (for example) an image with the
RMagickOutputter, or an ASCII string such as the one below.

See Barby::Barcode and Barby::Outputter for more information.

 require 'barby'
 require 'barby/outputter/ascii_outputter'

 barcode = Barby::Code128B.new('BARBY')
 
 puts barcode.to_ascii

 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
 ## #    #  #   # ##   # #   ##   ##   # ### #   # ##   ### ## #   ## ### ### ##   ### # ##
            B          A          R          B          Y                                  
Something went wrong with that request. Please try again.