zint 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/LICENSE +10 -0
- data/{README.rdoc → README.md} +13 -11
- data/lib/zint/version.rb +1 -1
- data/lib/zint/zint_symbol.rb +12 -3
- data/test/fixtures/qrcode.ecc_h.png +0 -0
- data/test/qrcode_test.rb +14 -13
- data/zint.gemspec +10 -6
- metadata +27 -35
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1508fa649df06932175af81a1fa92f79d0de5619865ba29c6280f44543254b75
|
4
|
+
data.tar.gz: 82daace232a11917dba9ba2eb3d0893207520df6392b4f05b09047fbae0014f6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e3bcd0124821f6a21ff710bd49923357f716ee62663ac23c614a7eda5586523052f1f847f132c578432f9a5db4c531f4c53799c3041d7d9f5add52f9fe7ba702
|
7
|
+
data.tar.gz: 58c8b73b84a7d99c7169606a89c03369cf5a671b20f4d5c24d94bf1daa696680051df1b5419f19b2815104f42ce9790f9be3fce094ce7dfc3e2f1b5d4814442b
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
The MIT License
|
2
|
+
===============
|
3
|
+
|
4
|
+
Copyright 2018 Angel Pizarro
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
7
|
+
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
9
|
+
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,26 +1,28 @@
|
|
1
1
|
|
2
2
|
= Zint
|
3
3
|
|
4
|
-
|
4
|
+
This is a Ruby FFI wrapper for the Zint barcode generation library (http://www.zint.org.uk).
|
5
5
|
|
6
|
-
|
6
|
+
== Installing Zint
|
7
7
|
|
8
|
-
|
8
|
+
For OS X leverage the [Homebrew](https://brew.sh)
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
The zint library version 2.4.3 does not seem to encode high ECC qrcodes. I've commented out those test and put in a to-do to fix it later.
|
10
|
+
```sh
|
11
|
+
brew install zint
|
12
|
+
```
|
15
13
|
|
14
|
+
Other platforms require building [from source](https://sourceforge.net/projects/zint/files/). Follow the [Zint installation instructions](http://www.zint.org.uk/Manual.aspx?type=p&page=2).
|
16
15
|
|
16
|
+
**NOTE:** We assume that you are using Zint version [2.6.3_rc2](https://sourceforge.net/projects/zint/files/zint/2.6.3/) but future releases should work well enough.
|
17
17
|
|
18
18
|
== Installation
|
19
19
|
|
20
20
|
As mentioned, <b> you must install zint</b> to be able to use this gem. Once that dependency is satisfied, then you can just do the usual gem install.
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
|
22
|
+
```sh
|
23
|
+
gem install zint
|
24
|
+
|
25
|
+
```
|
24
26
|
|
25
27
|
== Usage
|
26
28
|
|
data/lib/zint/version.rb
CHANGED
data/lib/zint/zint_symbol.rb
CHANGED
@@ -2,6 +2,9 @@ module Zint
|
|
2
2
|
# An FFI wrapper for the Zint C library zint_symbol struct.
|
3
3
|
# You should not use this directly, use the Zint::Barcode or
|
4
4
|
# its decendents instead.
|
5
|
+
#
|
6
|
+
# For Zint v2.6.3
|
7
|
+
#
|
5
8
|
class ZintSymbol < FFI::ManagedStruct
|
6
9
|
layout :symbology, :int,
|
7
10
|
:height, :int,
|
@@ -16,17 +19,23 @@ module Zint
|
|
16
19
|
:option_2, :int,
|
17
20
|
:option_3, :int,
|
18
21
|
:show_hrt, :int,
|
22
|
+
:fontsize, :int,
|
19
23
|
:input_mode, :int,
|
24
|
+
:eci, :int,
|
20
25
|
:text, [:uchar, 128],
|
21
26
|
:rows, :int,
|
22
27
|
:width, :int,
|
23
28
|
:primary, [:char, 128],
|
24
|
-
:encoded_data , [:uchar,
|
25
|
-
:row_height, [:int,
|
29
|
+
:encoded_data , [:uchar, 200*143],
|
30
|
+
:row_height, [:int, 200],
|
26
31
|
:errtxt, [:char, 100],
|
27
32
|
:bitmap, :pointer,
|
28
33
|
:bitmap_width, :int,
|
29
|
-
:bitmap_height, :int
|
34
|
+
:bitmap_height, :int,
|
35
|
+
:bitmap_byte_length, :uchar,
|
36
|
+
:dot_size, :float,
|
37
|
+
:zint_render, :pointer,
|
38
|
+
:debug, :int
|
30
39
|
|
31
40
|
# release method required for FFI managed structs
|
32
41
|
def self.release ptr
|
Binary file
|
data/test/qrcode_test.rb
CHANGED
@@ -41,20 +41,21 @@ class QRCodeTest < Test::Unit::TestCase
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
## TO-DO: Figure out why this does not work.
|
45
|
+
context "QRCode High ECC" do
|
46
|
+
setup do
|
47
|
+
@bc = Zint::QRCode.new("http://rubygems.org/gems/zint", Zint::QRCode::ECC_H, :path => 'qrh.png')
|
48
|
+
@bc.print!
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
should "create an object" do
|
52
|
+
assert @bc
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
should "create a PNG file that is the same as the test fixture" do
|
56
|
+
test_fixture = File.join(File.dirname(__FILE__) , 'fixtures', "qrcode.ecc_h.png")
|
57
|
+
assert_equal(Digest::MD5.file(test_fixture) , Digest::MD5.file(@bc.path))
|
58
|
+
end
|
58
59
|
|
59
|
-
|
60
|
+
end
|
60
61
|
end
|
data/zint.gemspec
CHANGED
@@ -6,21 +6,25 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.version = Zint::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = "Angel Pizarro"
|
9
|
-
s.email = "
|
9
|
+
s.email = "delagoya@gmail.com"
|
10
10
|
s.homepage = "http://rubygems.org/gems/zint"
|
11
11
|
s.summary = "Ruby FFI wrapper on Zint barcode library"
|
12
12
|
s.description = "Ruby FFI wrapper on Zint barcode library. See README for more details"
|
13
|
-
|
14
|
-
s.required_rubygems_version = ">=
|
13
|
+
s.license = "MIT"
|
14
|
+
s.required_rubygems_version = ">= 2"
|
15
15
|
s.rubyforge_project = "zint"
|
16
16
|
|
17
17
|
s.add_dependency("ffi", "~> 1.2")
|
18
18
|
|
19
|
-
s.add_development_dependency "bundler", "~> 1.
|
20
|
-
s.add_development_dependency "shoulda", "~>
|
19
|
+
s.add_development_dependency "bundler", "~> 1.17"
|
20
|
+
s.add_development_dependency "shoulda", "~> 3.6"
|
21
21
|
s.add_development_dependency "yard"
|
22
22
|
|
23
23
|
s.files = `git ls-files`.split("\n")
|
24
|
-
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
24
|
+
# s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
25
25
|
s.require_path = 'lib'
|
26
|
+
|
27
|
+
# YARD documentation
|
28
|
+
s.metadata["yard.run"] = "yri"
|
29
|
+
|
26
30
|
end
|
metadata
CHANGED
@@ -1,90 +1,82 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Angel Pizarro
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ffi
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.2'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.2'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '1.
|
33
|
+
version: '1.17'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '1.
|
40
|
+
version: '1.17'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: shoulda
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '3.6'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
54
|
+
version: '3.6'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: yard
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
description: Ruby FFI wrapper on Zint barcode library. See README for more details
|
79
|
-
email:
|
70
|
+
email: delagoya@gmail.com
|
80
71
|
executables: []
|
81
72
|
extensions: []
|
82
73
|
extra_rdoc_files: []
|
83
74
|
files:
|
84
|
-
- .gitignore
|
75
|
+
- ".gitignore"
|
85
76
|
- CHANGELOG
|
86
77
|
- Gemfile
|
87
|
-
-
|
78
|
+
- LICENSE
|
79
|
+
- README.md
|
88
80
|
- Rakefile
|
89
81
|
- lib/zint.rb
|
90
82
|
- lib/zint/barcode.rb
|
@@ -107,28 +99,28 @@ files:
|
|
107
99
|
- test/zint_test.rb
|
108
100
|
- zint.gemspec
|
109
101
|
homepage: http://rubygems.org/gems/zint
|
110
|
-
licenses:
|
102
|
+
licenses:
|
103
|
+
- MIT
|
104
|
+
metadata:
|
105
|
+
yard.run: yri
|
111
106
|
post_install_message:
|
112
107
|
rdoc_options: []
|
113
108
|
require_paths:
|
114
109
|
- lib
|
115
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
117
111
|
requirements:
|
118
|
-
- -
|
112
|
+
- - ">="
|
119
113
|
- !ruby/object:Gem::Version
|
120
114
|
version: '0'
|
121
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
116
|
requirements:
|
124
|
-
- -
|
117
|
+
- - ">="
|
125
118
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
119
|
+
version: '2'
|
127
120
|
requirements: []
|
128
121
|
rubyforge_project: zint
|
129
|
-
rubygems_version:
|
122
|
+
rubygems_version: 2.7.6
|
130
123
|
signing_key:
|
131
|
-
specification_version:
|
124
|
+
specification_version: 4
|
132
125
|
summary: Ruby FFI wrapper on Zint barcode library
|
133
126
|
test_files: []
|
134
|
-
has_rdoc:
|