barcodes 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -5
- data/lib/barcodes.rb +14 -0
- data/lib/barcodes/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -46,11 +46,7 @@ If you want to create and render a barcode all in one step you can simply do the
|
|
46
46
|
|
47
47
|
The output path can be left empty and the rendered output will be returned as a string.
|
48
48
|
|
49
|
-
By default Barcodes uses the PDF renderer. To use
|
50
|
-
|
51
|
-
Barcodes.render('Codabar', '/path/to/output.pdf', {:data => '12345'}, Barcodes::Renderer::Ascii)
|
52
|
-
|
53
|
-
You could also do this:
|
49
|
+
By default Barcodes uses the PDF renderer. To use a different renderer do the following:
|
54
50
|
|
55
51
|
barcode = Barcodes.create('Postnet', {:data => '44555'})
|
56
52
|
|
data/lib/barcodes.rb
CHANGED
@@ -94,6 +94,20 @@ module Barcodes
|
|
94
94
|
else
|
95
95
|
raise ArgumentError, 'Unsupported symbology'
|
96
96
|
end
|
97
|
+
|
98
|
+
# Creates a new barcode of type <symbology> with given
|
99
|
+
# options and renders barcode.
|
100
|
+
#
|
101
|
+
# Optionally takes <filename>. If no
|
102
|
+
# filename is given rendering will be outputted as a
|
103
|
+
# string.
|
104
|
+
#
|
105
|
+
# Uses PDF renderer by default.
|
106
|
+
#
|
107
|
+
# See Barcodes::Symbology::Base for options
|
108
|
+
def render(symbology, filename=nil, options={})
|
109
|
+
Barcodes::Renderer::Pdf.new(self.create(symbology, options)).render(filename)
|
110
|
+
end
|
97
111
|
end
|
98
112
|
end
|
99
113
|
end
|
data/lib/barcodes/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barcodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
segments:
|
150
150
|
- 0
|
151
|
-
hash:
|
151
|
+
hash: 2407393715627331748
|
152
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
153
|
none: false
|
154
154
|
requirements:
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
version: '0'
|
158
158
|
segments:
|
159
159
|
- 0
|
160
|
-
hash:
|
160
|
+
hash: 2407393715627331748
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project: barcodes
|
163
163
|
rubygems_version: 1.8.24
|