usps_intelligent_barcode 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/CHANGELOG.markdown +4 -0
- data/Gemfile.lock +3 -0
- data/README.markdown +5 -0
- data/USPS-intelligent-barcode.gemspec +95 -0
- data/VERSION +1 -1
- data/examples/example.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/usps_intelligent_barcode.gemspec +4 -19
- metadata +22 -38
- data/lib/USPS-intelligent-barcode/bar_map.rb +0 -52
- data/lib/USPS-intelligent-barcode/bar_position.rb +0 -40
- data/lib/USPS-intelligent-barcode/bar_symbol.rb +0 -49
- data/lib/USPS-intelligent-barcode/bar_to_character_mapping.yml +0 -66
- data/lib/USPS-intelligent-barcode/barcode.rb +0 -152
- data/lib/USPS-intelligent-barcode/barcode_id.rb +0 -98
- data/lib/USPS-intelligent-barcode/character_position.rb +0 -28
- data/lib/USPS-intelligent-barcode/codeword_map.rb +0 -38
- data/lib/USPS-intelligent-barcode/codeword_to_character_mapping.yml +0 -1366
- data/lib/USPS-intelligent-barcode/crc.rb +0 -52
- data/lib/USPS-intelligent-barcode/mailer_id.rb +0 -105
- data/lib/USPS-intelligent-barcode/numeric_conversions.rb +0 -22
- data/lib/USPS-intelligent-barcode/routing_code.rb +0 -134
- data/lib/USPS-intelligent-barcode/serial_number.rb +0 -88
- data/lib/USPS-intelligent-barcode/service_type.rb +0 -79
- data/lib/USPS-intelligent-barcode.rb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
M2FiMDFlNjUzNWIyNGQxODM4MzI2MjlmNzZkMGVlN2YzNTcyZmUxZQ==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
YTUzZDMyYWQ4NjQ3ZGZlMzEyNDVlZmEzNzdkN2Q2ZDcwNmE0YTk2OA==
|
|
5
7
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
MDIxZTQyM2ZiMTVjZjgwOTA3MTU4MmExMDk4ZDI5ODcwNzU5NTFhMDMyZjdi
|
|
10
|
+
NzA5NDJhYWY1YWZlNWEyM2Y1OTUyZDA2NWYwYTQ3MDE4NGQ5ZTYyYTYwMTE5
|
|
11
|
+
MDZjNDkzNjkyNjVjM2ViMGYzZjVlZTNlZWI1NDVjZTI3NDJmNDU=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
Zjk3Mzk1OWFiODczMWI1MDE0Njg0N2Q1MjY3YWI5NjJhNDU2NzBhNTQxNWE1
|
|
14
|
+
ZDAyMmY0YTM1ZDU2NmE0MGE1NzUzZDZkYzYzODhhNDUzMGU1Yjk3Y2IyMjA0
|
|
15
|
+
OTI3MmVmYTM1YTA1ZDQ3ZjUwMzJmZGFlNzZlZTlmZDUyOThjNjg=
|
data/CHANGELOG.markdown
CHANGED
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
[](http://badge.fury.io/rb/usps_intelligent_barcode)
|
|
2
|
+
[](https://gemnasium.com/wconrad/usps_intelligent_barcode)
|
|
3
|
+
[](https://travis-ci.org/wconrad/usps_intelligent_barcode)
|
|
4
|
+
[](https://codeclimate.com/github/wconrad/usps_intelligent_barcode)
|
|
5
|
+
|
|
1
6
|
USPS-intelligent-barcode is a pure ruby gem to generate a USPS IMB
|
|
2
7
|
(Intelligent Mail Barcode). More specifically, it generates the
|
|
3
8
|
string of characters you should print using one of the [USPS
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
# stub: USPS-intelligent-barcode 0.2.7 ruby lib
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = "USPS-intelligent-barcode"
|
|
9
|
+
s.version = "0.2.7"
|
|
10
|
+
|
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
+
s.require_paths = ["lib"]
|
|
13
|
+
s.authors = ["Wayne Conrad"]
|
|
14
|
+
s.date = "2015-06-13"
|
|
15
|
+
s.description = "A pure Ruby library to generate a USPS Intelligent Mail barcode. It generates the string of characters to print with one of the USPS Intelligent Mail barcode fonts. NOTE: Deprecated. Please use usps_intelligent_barcode instead.\n"
|
|
16
|
+
s.email = "wconrad@yagni.com"
|
|
17
|
+
s.extra_rdoc_files = [
|
|
18
|
+
"LICENSE.md"
|
|
19
|
+
]
|
|
20
|
+
s.files = [
|
|
21
|
+
"Gemfile",
|
|
22
|
+
"Gemfile.lock",
|
|
23
|
+
"LICENSE.md",
|
|
24
|
+
"Rakefile",
|
|
25
|
+
"USPS-intelligent-barcode.gemspec",
|
|
26
|
+
"VERSION",
|
|
27
|
+
"examples/example.rb",
|
|
28
|
+
"lib/USPS-intelligent-barcode.rb",
|
|
29
|
+
"lib/USPS-intelligent-barcode/bar_map.rb",
|
|
30
|
+
"lib/USPS-intelligent-barcode/bar_position.rb",
|
|
31
|
+
"lib/USPS-intelligent-barcode/bar_symbol.rb",
|
|
32
|
+
"lib/USPS-intelligent-barcode/bar_to_character_mapping.yml",
|
|
33
|
+
"lib/USPS-intelligent-barcode/barcode.rb",
|
|
34
|
+
"lib/USPS-intelligent-barcode/barcode_id.rb",
|
|
35
|
+
"lib/USPS-intelligent-barcode/character_position.rb",
|
|
36
|
+
"lib/USPS-intelligent-barcode/codeword_map.rb",
|
|
37
|
+
"lib/USPS-intelligent-barcode/codeword_to_character_mapping.yml",
|
|
38
|
+
"lib/USPS-intelligent-barcode/crc.rb",
|
|
39
|
+
"lib/USPS-intelligent-barcode/mailer_id.rb",
|
|
40
|
+
"lib/USPS-intelligent-barcode/numeric_conversions.rb",
|
|
41
|
+
"lib/USPS-intelligent-barcode/routing_code.rb",
|
|
42
|
+
"lib/USPS-intelligent-barcode/serial_number.rb",
|
|
43
|
+
"lib/USPS-intelligent-barcode/service_type.rb",
|
|
44
|
+
"spec/bar_map_spec.rb",
|
|
45
|
+
"spec/bar_position_spec.rb",
|
|
46
|
+
"spec/bar_symbol_spec.rb",
|
|
47
|
+
"spec/barcode_id_spec.rb",
|
|
48
|
+
"spec/barcode_spec.rb",
|
|
49
|
+
"spec/character_position_spec.rb",
|
|
50
|
+
"spec/codeword_map_spec.rb",
|
|
51
|
+
"spec/crc_spec.rb",
|
|
52
|
+
"spec/mailer_id_spec.rb",
|
|
53
|
+
"spec/numeric_conversions_spec.rb",
|
|
54
|
+
"spec/routing_code_spec.rb",
|
|
55
|
+
"spec/serial_number_spec.rb",
|
|
56
|
+
"spec/service_type_spec.rb",
|
|
57
|
+
"spec/spec_helper.rb"
|
|
58
|
+
]
|
|
59
|
+
s.homepage = "http://github.com/wconrad/USPS-intelligent-barcode"
|
|
60
|
+
s.licenses = ["MIT"]
|
|
61
|
+
s.post_install_message = " The USPS-intelligent-barcode gem has been deprecated and has been\n replaced by usps-intelligent-barcode.\n See: https://rubygems.org/gems/usps_intelligent_barcode\n And: https://github.com/wconrad/usps_intellgent_barcode\n"
|
|
62
|
+
s.rubygems_version = "2.4.3"
|
|
63
|
+
s.summary = "Generates a USPS Intelligent Mail Barcode."
|
|
64
|
+
|
|
65
|
+
if s.respond_to? :specification_version then
|
|
66
|
+
s.specification_version = 4
|
|
67
|
+
|
|
68
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
69
|
+
s.add_runtime_dependency(%q<andand>, ["~> 1.3.3"])
|
|
70
|
+
s.add_runtime_dependency(%q<memoizer>, ["~> 1.0.1"])
|
|
71
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
|
72
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
|
73
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
|
74
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
|
75
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
76
|
+
else
|
|
77
|
+
s.add_dependency(%q<andand>, ["~> 1.3.3"])
|
|
78
|
+
s.add_dependency(%q<memoizer>, ["~> 1.0.1"])
|
|
79
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
80
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
81
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
82
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
|
83
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
s.add_dependency(%q<andand>, ["~> 1.3.3"])
|
|
87
|
+
s.add_dependency(%q<memoizer>, ["~> 1.0.1"])
|
|
88
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
89
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
90
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
91
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
|
92
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.1
|
data/examples/example.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: usps_intelligent_barcode 0.3.
|
|
5
|
+
# stub: usps_intelligent_barcode 0.3.1 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "usps_intelligent_barcode"
|
|
9
|
-
s.version = "0.3.
|
|
9
|
+
s.version = "0.3.1"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib"]
|
|
@@ -26,24 +26,9 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
"LICENSE.md",
|
|
27
27
|
"README.markdown",
|
|
28
28
|
"Rakefile",
|
|
29
|
+
"USPS-intelligent-barcode.gemspec",
|
|
29
30
|
"VERSION",
|
|
30
31
|
"examples/example.rb",
|
|
31
|
-
"lib/USPS-intelligent-barcode.rb",
|
|
32
|
-
"lib/USPS-intelligent-barcode/bar_map.rb",
|
|
33
|
-
"lib/USPS-intelligent-barcode/bar_position.rb",
|
|
34
|
-
"lib/USPS-intelligent-barcode/bar_symbol.rb",
|
|
35
|
-
"lib/USPS-intelligent-barcode/bar_to_character_mapping.yml",
|
|
36
|
-
"lib/USPS-intelligent-barcode/barcode.rb",
|
|
37
|
-
"lib/USPS-intelligent-barcode/barcode_id.rb",
|
|
38
|
-
"lib/USPS-intelligent-barcode/character_position.rb",
|
|
39
|
-
"lib/USPS-intelligent-barcode/codeword_map.rb",
|
|
40
|
-
"lib/USPS-intelligent-barcode/codeword_to_character_mapping.yml",
|
|
41
|
-
"lib/USPS-intelligent-barcode/crc.rb",
|
|
42
|
-
"lib/USPS-intelligent-barcode/mailer_id.rb",
|
|
43
|
-
"lib/USPS-intelligent-barcode/numeric_conversions.rb",
|
|
44
|
-
"lib/USPS-intelligent-barcode/routing_code.rb",
|
|
45
|
-
"lib/USPS-intelligent-barcode/serial_number.rb",
|
|
46
|
-
"lib/USPS-intelligent-barcode/service_type.rb",
|
|
47
32
|
"lib/usps_intelligent_barcode.rb",
|
|
48
33
|
"lib/usps_intelligent_barcode/bar_map.rb",
|
|
49
34
|
"lib/usps_intelligent_barcode/bar_position.rb",
|
|
@@ -78,7 +63,7 @@ Gem::Specification.new do |s|
|
|
|
78
63
|
]
|
|
79
64
|
s.homepage = "http://github.com/wconrad/usps_intelligent_barcode"
|
|
80
65
|
s.licenses = ["MIT"]
|
|
81
|
-
s.rubygems_version = "2.4.
|
|
66
|
+
s.rubygems_version = "2.4.3"
|
|
82
67
|
s.summary = "Generates a USPS Intelligent Mail Barcode."
|
|
83
68
|
|
|
84
69
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: usps_intelligent_barcode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wayne Conrad
|
|
@@ -14,112 +14,112 @@ dependencies:
|
|
|
14
14
|
name: andand
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '1.3'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ~>
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.3'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: memoizer
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ~>
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '1.0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ~>
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '1.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: jeweler
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ~>
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '2.0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - ~>
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '2.0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rspec
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '3.3'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ~>
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '3.3'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rspec-its
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- -
|
|
73
|
+
- - ~>
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '1.0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- -
|
|
80
|
+
- - ~>
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '1.0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: simplecov
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - ~>
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: 0.10.0
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - ~>
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 0.10.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: yard
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- -
|
|
101
|
+
- - ~>
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: 0.8.5
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- -
|
|
108
|
+
- - ~>
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: 0.8.5
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: rake
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- -
|
|
115
|
+
- - ~>
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '10.0'
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- -
|
|
122
|
+
- - ~>
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '10.0'
|
|
125
125
|
description: A pure Ruby library to generate a USPS Intelligent Mail barcode. It
|
|
@@ -132,31 +132,16 @@ extra_rdoc_files:
|
|
|
132
132
|
- LICENSE.md
|
|
133
133
|
- README.markdown
|
|
134
134
|
files:
|
|
135
|
-
-
|
|
135
|
+
- .travis.yml
|
|
136
136
|
- CHANGELOG.markdown
|
|
137
137
|
- Gemfile
|
|
138
138
|
- Gemfile.lock
|
|
139
139
|
- LICENSE.md
|
|
140
140
|
- README.markdown
|
|
141
141
|
- Rakefile
|
|
142
|
+
- USPS-intelligent-barcode.gemspec
|
|
142
143
|
- VERSION
|
|
143
144
|
- examples/example.rb
|
|
144
|
-
- lib/USPS-intelligent-barcode.rb
|
|
145
|
-
- lib/USPS-intelligent-barcode/bar_map.rb
|
|
146
|
-
- lib/USPS-intelligent-barcode/bar_position.rb
|
|
147
|
-
- lib/USPS-intelligent-barcode/bar_symbol.rb
|
|
148
|
-
- lib/USPS-intelligent-barcode/bar_to_character_mapping.yml
|
|
149
|
-
- lib/USPS-intelligent-barcode/barcode.rb
|
|
150
|
-
- lib/USPS-intelligent-barcode/barcode_id.rb
|
|
151
|
-
- lib/USPS-intelligent-barcode/character_position.rb
|
|
152
|
-
- lib/USPS-intelligent-barcode/codeword_map.rb
|
|
153
|
-
- lib/USPS-intelligent-barcode/codeword_to_character_mapping.yml
|
|
154
|
-
- lib/USPS-intelligent-barcode/crc.rb
|
|
155
|
-
- lib/USPS-intelligent-barcode/mailer_id.rb
|
|
156
|
-
- lib/USPS-intelligent-barcode/numeric_conversions.rb
|
|
157
|
-
- lib/USPS-intelligent-barcode/routing_code.rb
|
|
158
|
-
- lib/USPS-intelligent-barcode/serial_number.rb
|
|
159
|
-
- lib/USPS-intelligent-barcode/service_type.rb
|
|
160
145
|
- lib/usps_intelligent_barcode.rb
|
|
161
146
|
- lib/usps_intelligent_barcode/bar_map.rb
|
|
162
147
|
- lib/usps_intelligent_barcode/bar_position.rb
|
|
@@ -198,19 +183,18 @@ require_paths:
|
|
|
198
183
|
- lib
|
|
199
184
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
185
|
requirements:
|
|
201
|
-
- -
|
|
186
|
+
- - ! '>='
|
|
202
187
|
- !ruby/object:Gem::Version
|
|
203
188
|
version: '0'
|
|
204
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
190
|
requirements:
|
|
206
|
-
- -
|
|
191
|
+
- - ! '>='
|
|
207
192
|
- !ruby/object:Gem::Version
|
|
208
193
|
version: '0'
|
|
209
194
|
requirements: []
|
|
210
195
|
rubyforge_project:
|
|
211
|
-
rubygems_version: 2.4.
|
|
196
|
+
rubygems_version: 2.4.3
|
|
212
197
|
signing_key:
|
|
213
198
|
specification_version: 4
|
|
214
199
|
summary: Generates a USPS Intelligent Mail Barcode.
|
|
215
200
|
test_files: []
|
|
216
|
-
has_rdoc:
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
require 'USPS-intelligent-barcode/character_position'
|
|
2
|
-
|
|
3
|
-
# @!group Internal
|
|
4
|
-
|
|
5
|
-
module Imb
|
|
6
|
-
|
|
7
|
-
# Maps intelligent barcode "characters" to codes that indicate what
|
|
8
|
-
# type of bar to print at each given position.
|
|
9
|
-
|
|
10
|
-
class BarMap
|
|
11
|
-
|
|
12
|
-
def initialize
|
|
13
|
-
@mapping = load_mapping
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Given an array of intelligent barcode "characters", return an
|
|
17
|
-
# the symbols for each position.
|
|
18
|
-
# @param [[Integer]] characters array of characters
|
|
19
|
-
# @return [[BarSymbol]] array of symbols
|
|
20
|
-
|
|
21
|
-
def symbols(characters)
|
|
22
|
-
@mapping.map do |bar_position|
|
|
23
|
-
bar_position.map(characters)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
def load_mapping
|
|
30
|
-
convert_mapping_data(load_mapping_data)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def convert_mapping_data(mapping_data)
|
|
34
|
-
mapping_data.map do |descender, ascender|
|
|
35
|
-
descender_character_position = CharacterPosition.new(*descender)
|
|
36
|
-
ascender_character_position = CharacterPosition.new(*ascender)
|
|
37
|
-
BarPosition.new(descender_character_position,
|
|
38
|
-
ascender_character_position)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def load_mapping_data
|
|
43
|
-
YAML.load_file(mapping_path)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def mapping_path
|
|
47
|
-
File.expand_path('bar_to_character_mapping.yml', File.dirname(__FILE__))
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
end
|