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 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 the ASCII renderer you would do the following:
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
 
@@ -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
@@ -7,5 +7,5 @@
7
7
  #
8
8
  module Barcodes
9
9
  # Returns the current version
10
- VERSION = "0.0.5"
10
+ VERSION = "0.0.6"
11
11
  end
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.5
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: -1199627213254541142
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: -1199627213254541142
160
+ hash: 2407393715627331748
161
161
  requirements: []
162
162
  rubyforge_project: barcodes
163
163
  rubygems_version: 1.8.24