gbarcode-98-20 0.98.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Angel Pizarro on 2007-03-15.
4
+ # Copyright (c) 2007. All rights reserved.
5
+ require 'mkmf'
6
+ dir_config("barcode")
7
+ if have_library("barcode")
8
+ create_makefile('gbarcode')
9
+ else
10
+ raise Exception.new("GNU Barcode is no longer bundled with the gbarcode gem. Please install GNU barcode before installing this gem")
11
+ end
@@ -0,0 +1,44 @@
1
+ %!PS-Adobe-2.0 EPSF-1.2
2
+ %%Creator: libbarcode
3
+ %%BoundingBox: 0 0 143 100
4
+ %%EndComments
5
+ % Printing barcode for "Gbarcode", scaled 1.00, encoded using "code 128-B"
6
+ % The space/bar succession is represented by the following widths (space first):
7
+ % 02112142113131214211211241212411411221341111412211122143141112331112
8
+ [
9
+ % height xpos ypos width height xpos ypos width
10
+ [75.00 11.00 15.00 1.85] [75.00 13.50 15.00 0.85]
11
+ [75.00 16.50 15.00 0.85] [70.00 22.00 20.00 1.85]
12
+ [70.00 24.50 20.00 0.85] [70.00 28.50 20.00 0.85]
13
+ [70.00 32.50 20.00 0.85] [70.00 35.50 20.00 0.85]
14
+ [70.00 41.00 20.00 1.85] [70.00 43.50 20.00 0.85]
15
+ [70.00 46.50 20.00 0.85] [70.00 49.00 20.00 1.85]
16
+ [70.00 54.50 20.00 0.85] [70.00 57.50 20.00 0.85]
17
+ [70.00 62.00 20.00 3.85] [70.00 65.50 20.00 0.85]
18
+ [70.00 70.50 20.00 0.85] [70.00 73.00 20.00 1.85]
19
+ [70.00 76.50 20.00 0.85] [70.00 82.00 20.00 3.85]
20
+ [70.00 85.50 20.00 0.85] [70.00 87.50 20.00 0.85]
21
+ [70.00 92.50 20.00 0.85] [70.00 96.00 20.00 1.85]
22
+ [70.00 98.50 20.00 0.85] [70.00 101.00 20.00 1.85]
23
+ [70.00 104.50 20.00 0.85] [70.00 110.50 20.00 2.85]
24
+ [70.00 115.00 20.00 3.85] [70.00 118.50 20.00 0.85]
25
+ [75.00 121.00 15.00 1.85] [75.00 126.50 15.00 2.85]
26
+ [75.00 129.50 15.00 0.85] [75.00 132.00 15.00 1.85]
27
+
28
+ ] { {} forall setlinewidth moveto 0 exch rlineto stroke} bind forall
29
+ [
30
+ % char xpos ypos fontsize
31
+ [(G) 21.00 10.00 12.00]
32
+ [(b) 32.00 10.00 0.00]
33
+ [(a) 43.00 10.00 0.00]
34
+ [(r) 54.00 10.00 0.00]
35
+ [(c) 65.00 10.00 0.00]
36
+ [(o) 76.00 10.00 0.00]
37
+ [(d) 87.00 10.00 0.00]
38
+ [(e) 98.00 10.00 0.00]
39
+ ] { {} forall dup 0.00 ne {
40
+ /Helvetica findfont exch scalefont setfont
41
+ } {pop} ifelse
42
+ moveto show} bind forall
43
+ % End barcode for "Gbarcode"
44
+
@@ -0,0 +1,47 @@
1
+ require 'test_helper'
2
+
3
+ class GbarcodeTest < Test::Unit::TestCase
4
+ def setup
5
+ @bc_text = "Gbarcode"
6
+ @bc = Gbarcode.barcode_create(@bc_text)
7
+ Gbarcode.barcode_encode(@bc, Gbarcode::BARCODE_128B)
8
+ end
9
+
10
+ # def teardown
11
+ # Gbarcode.barcode_delete(@bc)
12
+ # end
13
+
14
+ def test_barcode_create
15
+ assert(@bc != nil, "@bc not created")
16
+ end
17
+
18
+ def test_barcode_delete
19
+ r = Gbarcode.barcode_delete(Gbarcode.barcode_create(@bc_text))
20
+ assert(r == 0, "barcode_delete failed")
21
+ end
22
+
23
+ def test_ascii
24
+ assert_equal(@bc.ascii, "Gbarcode")
25
+ end
26
+
27
+ def test_barcode_encode
28
+ b = Gbarcode.barcode_create("1234")
29
+ r = Gbarcode.barcode_encode(b, Gbarcode::BARCODE_39)
30
+ assert(r == 0, "encoding unsuccessful")
31
+ end
32
+
33
+ def test_encoding
34
+ assert_equal(@bc.encoding, "code 128-B")
35
+ end
36
+
37
+ def test_barcode_print
38
+ r,w = File.pipe
39
+ Gbarcode.barcode_print(@bc,w,Gbarcode::BARCODE_OUT_EPS)
40
+ w.close()
41
+ b = r.read
42
+ r.close()
43
+ f = File.open(File.dirname(__FILE__) + "/assets/gb-code128b.eps").read
44
+ assert_equal(b,f)
45
+ end
46
+
47
+ end
@@ -0,0 +1,3 @@
1
+ # alter load path
2
+ require 'test/unit'
3
+ require 'gbarcode'
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gbarcode-98-20
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.98.20
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Angel Pizarro
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-23 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A C extension that wraps the GNU Barcode project. For more Ruby-ish syntax,
15
+ you should use the Rbarcode gem.
16
+ email: angel@delagoya.com
17
+ executables: []
18
+ extensions:
19
+ - ext/extconf.rb
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ext/barcode_wrap.c
23
+ - ext/extconf.rb
24
+ - test/gbarcode_test.rb
25
+ - test/assets/gb-code128b.eps
26
+ - test/test_helper.rb
27
+ homepage: http://gbarcode.rubyforge.org
28
+ licenses: []
29
+ post_install_message:
30
+ rdoc_options:
31
+ - --exclude
32
+ - .c$
33
+ require_paths:
34
+ - .
35
+ - ext
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.8.4
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubyforge_project: gbarcode
50
+ rubygems_version: 1.8.24
51
+ signing_key:
52
+ specification_version: 3
53
+ summary: A C extension that wraps the GNU Barcode project.
54
+ test_files:
55
+ - test/gbarcode_test.rb
56
+ - test/assets/gb-code128b.eps
57
+ - test/test_helper.rb
58
+ has_rdoc: true