strokes 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +2 -2
  2. data/lib/strokes/barcode.rb +7 -3
  3. metadata +19 -8
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Strokes
2
2
 
3
- A ruby wrapper of the awsome [postscriptbarcode](http://code.google.com/p/postscriptbarcode/) library.
3
+ A ruby wrapper of the awesome [postscriptbarcode](http://code.google.com/p/postscriptbarcode/) library.
4
4
 
5
5
  Note: currently only PNG images are supported.
6
6
 
7
7
  ## External Dependencies
8
8
 
9
9
  - You need to have [ghostscript](http://www.ghostscript.com/) installed and the `gs` command in your PATH.
10
- - If you want to use the `width` option you also need the `mogrify` command in your PATH, which is part of the [imagemagick](http://www.imagemagick.org) library.
10
+ - You also need the `mogrify` command in your PATH, which is part of the [imagemagick](http://www.imagemagick.org) library.
11
11
 
12
12
  ## Install
13
13
 
@@ -2,7 +2,7 @@ require 'subexec'
2
2
 
3
3
  module Strokes
4
4
 
5
- VALID_SYMBOLS = [:qrcode, :code39, :code128, :ean8, :ean13, :isbn, :upca, :upce]
5
+ VALID_SYMBOLS = [:qrcode, :code39, :code128, :ean8, :ean13, :isbn, :upca, :upce, :itf]
6
6
 
7
7
  class Barcode
8
8
 
@@ -41,12 +41,13 @@ module Strokes
41
41
  private
42
42
 
43
43
  def ps_commands(code_options, options = {})
44
+ symbol = options[:symbol] ? options[:symbol] : @symbol
44
45
  <<-PS
45
46
  <</Orientation 1>> setpagedevice
46
47
  #{options[:translate] || '100 680'} translate
47
48
  #{options[:rotate] || '-90'} rotate
48
49
  #{options[:scale] || '6 6'} scale
49
- 0 0 moveto (#{@content}) (#{code_options.join(' ')}) /#{@symbol} /uk.co.terryburton.bwipp findresource exec
50
+ 0 0 moveto (#{@content}) (#{code_options.join(' ')}) /#{symbol} /uk.co.terryburton.bwipp findresource exec
50
51
  showpage
51
52
  PS
52
53
  end
@@ -82,7 +83,10 @@ module Strokes
82
83
  def code128
83
84
  ps_commands(['includetext', @options], :scale => '4 4', :translate => '150 750')
84
85
  end
85
-
86
+
87
+ def itf
88
+ ps_commands(['includecheck', 'includetext', @options], :scale => '3 3', :symbol => 'interleaved2of5')
89
+ end
86
90
  end
87
91
 
88
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strokes
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-07 00:00:00.000000000Z
12
+ date: 2011-12-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: subexec
16
- requirement: &70314218516900 !ruby/object:Gem::Requirement
16
+ requirement: &70244215530100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70314218516900
24
+ version_requirements: *70244215530100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70314218516380 !ruby/object:Gem::Requirement
27
+ requirement: &70244215509120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,9 +32,20 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70314218516380
35
+ version_requirements: *70244215509120
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: &70244215507760 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70244215507760
36
47
  description: Generates PNG images of barcodes. Currently supports EAN8, EAN13, QR-Code,
37
- ISBN, CODE39, CODE128, UPCA, UPCE
48
+ ISBN, CODE39, CODE128, UPCA, UPCE, ITF
38
49
  email:
39
50
  - lars.kuhnt@gmail.com
40
51
  executables: []
@@ -72,5 +83,5 @@ rubyforge_project:
72
83
  rubygems_version: 1.8.10
73
84
  signing_key:
74
85
  specification_version: 3
75
- summary: Ruby wrapper for the awsome postscriptbarcode library
86
+ summary: Ruby wrapper for the awesome postscriptbarcode library
76
87
  test_files: []