upc_tools 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +15 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +41 -0
- data/.travis.yml +8 -6
- data/CODE_OF_CONDUCT.md +38 -41
- data/LICENSE +201 -21
- data/README.md +1 -0
- data/Rakefile +1 -1
- data/lib/upc_tools.rb +68 -70
- data/lib/upc_tools/version.rb +1 -1
- data/upc_tools.gemspec +14 -17
- metadata +10 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 41d8d28e5df44b15dcfbaad11704f0b1912a9ec0364093937169e9f5bc12089c
|
4
|
+
data.tar.gz: 55a445a4593fed4189bf779f64b9d09d3aa75f2a79a715fc099f17c29b3fb72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0224a9c626287503c2582a1be18b27e4f4717725442420fb5daa84bef98a9dfdcc37a30495bf59b5d82a696bb8b68da919fdc1ead50382992ad9aa2f709b19
|
7
|
+
data.tar.gz: 515b79461f5c139548615c07afffbfcd8ee9389ae11220895a920c54f0cc4ea9b4f83cb709e5addc014eaf5b6a25eb896fda471fc074c8da7f6dcb4760d9d539
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!-- *Before creating an issue please make sure you are using the latest version of sopstool.* -->
|
2
|
+
|
3
|
+
## Current Behavior
|
4
|
+
|
5
|
+
<!-- Describe the current behavior relevant to the issue -->
|
6
|
+
|
7
|
+
## Expected Behavior
|
8
|
+
|
9
|
+
<!-- Describe what you expect it to do, if it is in error -->
|
10
|
+
|
11
|
+
## Steps to reproduce
|
12
|
+
|
13
|
+
<!-- Please provide the steps necessary to reproduce this issue if it is a bug. -->
|
14
|
+
<!-- If you can, provide a link to a public repository which contains the files necessary to reproduce this. -->
|
15
|
+
<!-- Please mention your operating system and sops versions -->
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Story/Issue Link
|
2
|
+
-----
|
3
|
+
|
4
|
+
[#]()
|
5
|
+
|
6
|
+
Background
|
7
|
+
-----
|
8
|
+
|
9
|
+
Add background information that will be helpful to reviewers:
|
10
|
+
|
11
|
+
* Why are we making this change?
|
12
|
+
* How you arrived at this solution
|
13
|
+
* High level overview of when / how this code is executed
|
14
|
+
* Link to related Stories/Issues/PRs
|
15
|
+
|
16
|
+
Versioning
|
17
|
+
-----
|
18
|
+
|
19
|
+
Indicate the intended next version, and any special considerations
|
20
|
+
|
21
|
+
* Review the [Contributing Guide on Versioning](CONTRIBUTING.md#versioning)
|
22
|
+
* Ensure you are ready to increment an appropriate part of the version to release
|
23
|
+
|
24
|
+
Additional Requests to Reviewers
|
25
|
+
-----
|
26
|
+
|
27
|
+
Add any additional high-level requests for reviewers.
|
28
|
+
|
29
|
+
Tasks
|
30
|
+
-----
|
31
|
+
|
32
|
+
* [ ] Specs written
|
33
|
+
* [ ] Manual testing
|
34
|
+
|
35
|
+
/cc
|
36
|
+
-----
|
37
|
+
|
38
|
+
@mention any specific individuals you'd like to be aware of this change:
|
39
|
+
|
40
|
+
* Who is impacted by the work?
|
41
|
+
* Who knows this code best and can provide useful feedback?
|
data/.travis.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
rvm:
|
4
|
-
- "
|
5
|
-
- "2.
|
6
|
-
- "2.
|
7
|
-
- "2.
|
8
|
-
- "jruby-9.
|
9
|
-
before_install:
|
4
|
+
- "2.4"
|
5
|
+
- "2.5"
|
6
|
+
- "2.6"
|
7
|
+
- "2.7"
|
8
|
+
# - "jruby-9.1" #jruby can't run rake for some reason. skip it for now
|
9
|
+
before_install: # For jruby-head to work.
|
10
10
|
- gem install bundler
|
11
|
+
- gem update bundler
|
12
|
+
|
11
13
|
# uncomment this line if your project needs to run something other than `rake`:
|
12
14
|
# script: bundle exec rspec spec
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,49 +1,46 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
## Our Standards
|
8
|
+
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
10
|
+
|
11
|
+
* Using welcoming and inclusive language
|
12
|
+
* Being respectful of differing viewpoints and experiences
|
13
|
+
* Gracefully accepting constructive criticism
|
14
|
+
* Focusing on what is best for the community
|
15
|
+
* Showing empathy towards other community members
|
12
16
|
|
13
17
|
Examples of unacceptable behavior by participants include:
|
14
18
|
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
*
|
17
|
-
* Trolling or insulting/derogatory comments
|
19
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
20
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
18
21
|
* Public or private harassment
|
19
|
-
* Publishing
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
incident.
|
43
|
-
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
22
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
24
|
+
|
25
|
+
## Our Responsibilities
|
26
|
+
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
28
|
+
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
30
|
+
|
31
|
+
## Scope
|
32
|
+
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
34
|
+
|
35
|
+
## Enforcement
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at osscompliance@ibotta.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
|
+
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
|
+
|
41
|
+
## Attribution
|
42
|
+
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
47
44
|
|
48
45
|
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/LICENSE
CHANGED
@@ -1,21 +1,201 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# UpcTools
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/Ibotta/ruby_upc_tools.svg?branch=master)](https://travis-ci.org/Ibotta/ruby_upc_tools)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/upc_tools.svg)](https://badge.fury.io/rb/upc_tools)
|
4
5
|
|
5
6
|
Utilities to generate, convert and validate UPCs.
|
6
7
|
|
data/Rakefile
CHANGED
data/lib/upc_tools.rb
CHANGED
@@ -1,85 +1,84 @@
|
|
1
1
|
require "upc_tools/version"
|
2
2
|
|
3
|
-
#UPC Tools
|
3
|
+
# UPC Tools
|
4
4
|
module UpcTools
|
5
|
-
|
6
|
-
#Generate one UPC check digit
|
5
|
+
# Generate one UPC check digit
|
7
6
|
# @see http://www.gs1.org/barcodes/support/check_digit_calculator/
|
8
7
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf section 3.A.1.1
|
9
8
|
# @param num [String] base number to generate check digit for
|
10
9
|
# @return [Integer] check digit (always between 0-9)
|
11
10
|
def self.generate_upc_check_digit(num)
|
12
11
|
even = odd = 0
|
13
|
-
#pad everything to max (13)
|
14
|
-
num.to_s.rjust(13,
|
12
|
+
# pad everything to max (13)
|
13
|
+
num.to_s.rjust(13, "0").split("").each_with_index do |item, index|
|
15
14
|
item = item.to_i
|
16
|
-
even += item if index.odd? #opposite because of 0 indexing
|
15
|
+
even += item if index.odd? # opposite because of 0 indexing
|
17
16
|
odd += item if index.even?
|
18
17
|
end
|
19
18
|
chk_total = (odd * 3) + even
|
20
19
|
(10 - (chk_total % 10)) % 10
|
21
20
|
end
|
22
21
|
|
23
|
-
#Validate UPC check digit
|
22
|
+
# Validate UPC check digit
|
24
23
|
# @see http://www.gs1.org/barcodes/support/check_digit_calculator/
|
25
24
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf section 3.A.1.1
|
26
25
|
# @param upc [String] UPC with check digit to check
|
27
26
|
# @return [Boolean] truth of valid check digit
|
28
27
|
def self.valid_upc_check_digit?(upc)
|
29
|
-
full_upc = upc.to_s.rjust(14,
|
28
|
+
full_upc = upc.to_s.rjust(14, "0") # extend to full 14 digits first
|
30
29
|
gen_check = generate_upc_check_digit(full_upc[0, full_upc.size - 1])
|
31
30
|
full_upc[-1] == gen_check.to_s
|
32
31
|
end
|
33
32
|
|
34
|
-
#Add check digit and properly pad
|
33
|
+
# Add check digit and properly pad
|
35
34
|
# @param num [String] base number to extend
|
36
35
|
# @param extended_length [Integer] resulting target to pad number to
|
37
36
|
# @return [String] resulting UPC with check digit
|
38
|
-
def self.extend_upc_with_check_digit(num, extended_length=12)
|
37
|
+
def self.extend_upc_with_check_digit(num, extended_length = 12)
|
39
38
|
upc = num.to_s << generate_upc_check_digit(num).to_s
|
40
|
-
upc.rjust(extended_length,
|
39
|
+
upc.rjust(extended_length, "0") # extend to at least the given length
|
41
40
|
end
|
42
41
|
|
43
|
-
#Type 2 format 2 | ID3456 | X | 000P | C (Check X is optional, price can overflow in some cases)
|
42
|
+
# Type 2 format 2 | ID3456 | X | 000P | C (Check X is optional, price can overflow in some cases)
|
44
43
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf section 3.A.1.2
|
45
44
|
|
46
45
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf Figure 3.A.1.2 – 1 Weight Factor 2-
|
47
|
-
WEIGHT_FACTOR_2 = [0,2,4,6,8,9,1,3,5,7]
|
46
|
+
WEIGHT_FACTOR_2 = [0, 2, 4, 6, 8, 9, 1, 3, 5, 7]
|
48
47
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf Figure 3.A.1.2 – 2 Weight Factor 3
|
49
|
-
WEIGHT_FACTOR_3 = [0,3,6,9,2,5,8,1,4,7]
|
48
|
+
WEIGHT_FACTOR_3 = [0, 3, 6, 9, 2, 5, 8, 1, 4, 7]
|
50
49
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf Figure 3.A.1.2 – 2 Weight Factor 5+
|
51
|
-
WEIGHT_FACTOR_5plus = [0,5,1,6,2,7,3,8,4,9]
|
50
|
+
WEIGHT_FACTOR_5plus = [0, 5, 1, 6, 2, 7, 3, 8, 4, 9]
|
52
51
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf Figure 3.A.1.2 – 4 Weight Factor 5-
|
53
|
-
WEIGHT_FACTOR_5mins = [0,5,9,4,8,3,7,2,6,1]
|
52
|
+
WEIGHT_FACTOR_5mins = [0, 5, 9, 4, 8, 3, 7, 2, 6, 1]
|
54
53
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf Figure 3.A.1.2 – 4 inverse Weight Factor 5-
|
55
|
-
WEIGHT_FACTOR_5mins_opposite = [0,9,7,5,3,1,8,6,4,2]
|
54
|
+
WEIGHT_FACTOR_5mins_opposite = [0, 9, 7, 5, 3, 1, 8, 6, 4, 2]
|
56
55
|
|
57
|
-
#Trim UPC to proper length for type2 checking
|
56
|
+
# Trim UPC to proper length for type2 checking
|
58
57
|
# @param upc [String] UPC
|
59
58
|
# @return [String] trimmed string
|
60
59
|
def self.trim_type2_upc(upc)
|
61
|
-
#if length is > 12, strip leading 0
|
60
|
+
# if length is > 12, strip leading 0
|
62
61
|
upc = upc.to_s
|
63
|
-
upc = upc.gsub(/^0+/,
|
62
|
+
upc = upc.gsub(/^0+/, "") if upc.size > 12
|
64
63
|
upc
|
65
64
|
end
|
66
65
|
|
67
|
-
#Is this a type2 UPC?
|
66
|
+
# Is this a type2 UPC?
|
68
67
|
# @param upc [String] upc to check
|
69
68
|
# @return [Boolean] is UPC a type-2?
|
70
69
|
def self.type2_upc?(upc)
|
71
70
|
upc = trim_type2_upc(upc)
|
72
|
-
return false if upc.size > 13 || upc.size < 12 #length is wrong
|
73
|
-
upc.start_with?(
|
71
|
+
return false if upc.size > 13 || upc.size < 12 # length is wrong
|
72
|
+
upc.start_with?("2")
|
74
73
|
end
|
75
74
|
|
76
|
-
#Validate UPC and Price check digit for a type 2 upc. Does NOT also check the UPC itself
|
75
|
+
# Validate UPC and Price check digit for a type 2 upc. Does NOT also check the UPC itself
|
77
76
|
# @param upc [String] Type 2 UPC to check with check digit(s)
|
78
77
|
# @return [Boolean] matching check digit(s)?
|
79
78
|
def self.valid_type2_upc_check_digit?(upc)
|
80
79
|
upc = trim_type2_upc(upc)
|
81
80
|
return false unless type2_upc?(upc)
|
82
|
-
|
81
|
+
_plu, price, _chk, price_chk = split_type2_upc(upc)
|
83
82
|
price_chk_calc = if price.size == 4
|
84
83
|
generate_type2_upc_price_check_digit_4(price)
|
85
84
|
elsif price.size == 5
|
@@ -90,20 +89,20 @@ module UpcTools
|
|
90
89
|
price_chk == price_chk_calc.to_s
|
91
90
|
end
|
92
91
|
|
93
|
-
#Convenience method validates that upc is type2 with valid check digit
|
92
|
+
# Convenience method validates that upc is type2 with valid check digit
|
94
93
|
# @param upc [String] Type 2 UPC to check
|
95
94
|
# @return [Boolean] is UPC a type-2 with valid check digit(s)?
|
96
95
|
def self.valid_type2_upc?(upc)
|
97
96
|
type2_upc?(upc) && valid_type2_upc_check_digit?(upc)
|
98
97
|
end
|
99
98
|
|
100
|
-
#Convert item ID (PLU) and price to type2 UPC string
|
99
|
+
# Convert item ID (PLU) and price to type2 UPC string
|
101
100
|
# @param plu [String] item identifier (not including leading 2)
|
102
101
|
# @param price [String] price as integer (in cents). Will be 0 padded if necessary
|
103
102
|
# @param opts [Hash] options hash
|
104
103
|
# @option opts [Integer] :price_length (4) price length (4 or 5). Will override given price length.
|
105
104
|
# @option opts [Integer] :upc_length (12) price length (12 or 13)
|
106
|
-
def self.item_price_to_type2(plu, price, opts={})
|
105
|
+
def self.item_price_to_type2(plu, price, opts = {})
|
107
106
|
upc_length = opts[:upc_length] || 12
|
108
107
|
price_length = opts[:price_length] || 4
|
109
108
|
raise ArgumentError, "opts[:upc_length] must be 12 or 13" if upc_length != 12 && upc_length != 13
|
@@ -117,7 +116,7 @@ module UpcTools
|
|
117
116
|
plu = plu.to_s
|
118
117
|
raise ArgumentError, "plu must be 5 digits long" if plu.size != 5
|
119
118
|
|
120
|
-
price = price.to_s.rjust(price_length,
|
119
|
+
price = price.to_s.rjust(price_length, "0")
|
121
120
|
raise ArgumentError, "price must be less than or equal to 5 digits long" if price.size > 5
|
122
121
|
|
123
122
|
price_chk_calc = if price.size == 4
|
@@ -125,38 +124,38 @@ module UpcTools
|
|
125
124
|
elsif price.size == 5 && upc_length == 13
|
126
125
|
generate_type2_upc_price_check_digit_5(price)
|
127
126
|
else
|
128
|
-
|
127
|
+
""
|
129
128
|
end
|
130
129
|
|
131
130
|
upc = "2#{plu}#{price_chk_calc}#{price}"
|
132
131
|
upc << generate_upc_check_digit(upc).to_s
|
133
132
|
end
|
134
133
|
|
135
|
-
#Split a Type2 UPC into its component parts
|
134
|
+
# Split a Type2 UPC into its component parts
|
136
135
|
# @see http://www.meattrack.com/Background/UPC.php
|
137
136
|
# @see http://www.iddba.org/upccharacter2.aspx
|
138
137
|
# @param upc [String] UPC to split up
|
139
138
|
# @param skip_price_check [Boolean] Ignore price check digit (include digit in price field)
|
140
139
|
# @return [Array<String>] elements of array: ItemID/PLU (not including leading 2), Price, UPC Check Digit, Price Check Digit
|
141
|
-
def self.split_type2_upc(upc, skip_price_check=false)
|
140
|
+
def self.split_type2_upc(upc, skip_price_check = false)
|
142
141
|
upc = trim_type2_upc(upc)
|
143
|
-
plu = upc[1,5]
|
142
|
+
plu = upc[1, 5]
|
144
143
|
chk = upc[-1]
|
145
144
|
if upc.size == 13 || skip_price_check
|
146
145
|
price = upc[-6, 5]
|
147
146
|
price_chk = upc[-7] unless skip_price_check
|
148
147
|
else
|
149
|
-
price = upc[-5,4]
|
148
|
+
price = upc[-5, 4]
|
150
149
|
price_chk = upc[-6] unless skip_price_check
|
151
150
|
end
|
152
151
|
[plu, price, chk, price_chk]
|
153
152
|
end
|
154
153
|
|
155
|
-
#Get the float price from a Type2 UPC
|
154
|
+
# Get the float price from a Type2 UPC
|
156
155
|
# @param upc [String] UPC to get price from
|
157
156
|
# @param skip_price_check [Boolean] Ignore price check digit (include digit in price field)
|
158
157
|
# @return [Float] calculated price (rounded to nearest cent)
|
159
|
-
def self.get_price_from_type2_upc(upc, skip_price_check=false)
|
158
|
+
def self.get_price_from_type2_upc(upc, skip_price_check = false)
|
160
159
|
_, price = UpcTools.split_type2_upc(upc, skip_price_check)
|
161
160
|
(price.to_f / 100.0).round(2)
|
162
161
|
end
|
@@ -166,25 +165,25 @@ module UpcTools
|
|
166
165
|
# @return [Array<String,Float>] elements of array: type2 UPC string, Price. The UPC ends up with a 0 price if it is type2. The Price will be nil if the number passed in is not type2.
|
167
166
|
def self.type2_number_price(number)
|
168
167
|
if type2_upc?(number) && valid_type2_upc_check_digit?(number)
|
169
|
-
#looks like a type-2 and the price chk is valid
|
168
|
+
# looks like a type-2 and the price chk is valid
|
170
169
|
item_code, price = split_type2_upc(number)
|
171
170
|
price = (price.to_f / 100.0).round(2)
|
172
171
|
|
173
|
-
upc = item_price_to_type2(item_code, 0).rjust(14,
|
172
|
+
upc = item_price_to_type2(item_code, 0).rjust(14, "0")
|
174
173
|
[upc, price]
|
175
174
|
else
|
176
175
|
[number, nil]
|
177
176
|
end
|
178
177
|
end
|
179
178
|
|
180
|
-
#Generate price check digit for type 2 upc price of 4 digits
|
179
|
+
# Generate price check digit for type 2 upc price of 4 digits
|
181
180
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf section 3.A.1.3
|
182
181
|
# @see http://barcodes.gs1us.org/GS1%20US%20BarCodes%20and%20eCom%20-%20The%20Global%20Language%20of%20Business.htm
|
183
182
|
# @param price [String] price as integer (in cents)
|
184
183
|
# @return [Integer] calculated price check digit
|
185
184
|
def self.generate_type2_upc_price_check_digit_4(price)
|
186
|
-
#digit weighting factors 2-, 2-, 3, 5-
|
187
|
-
digits = price.to_s.rjust(4,
|
185
|
+
# digit weighting factors 2-, 2-, 3, 5-
|
186
|
+
digits = price.to_s.rjust(4, "0").split("").map(&:to_i)
|
188
187
|
sum = 0
|
189
188
|
sum += WEIGHT_FACTOR_2[digits[0]]
|
190
189
|
sum += WEIGHT_FACTOR_2[digits[1]]
|
@@ -193,13 +192,13 @@ module UpcTools
|
|
193
192
|
(sum * 3) % 10
|
194
193
|
end
|
195
194
|
|
196
|
-
#Generate price check digit for type 2 upc price of 5 digits
|
195
|
+
# Generate price check digit for type 2 upc price of 5 digits
|
197
196
|
# @see http://www.gs1tw.org/twct/web/BarCode/GS1_Section3V6-0.pdf section 3.A.1.4
|
198
197
|
# @param price [String] price as integer (in cents)
|
199
198
|
# @return [Integer] calculated price check digit
|
200
199
|
def self.generate_type2_upc_price_check_digit_5(price)
|
201
|
-
#digit weighting factors 5+, 2-, 5-, 5+, 2- => opposite of 5-
|
202
|
-
digits = price.to_s.rjust(5,
|
200
|
+
# digit weighting factors 5+, 2-, 5-, 5+, 2- => opposite of 5-
|
201
|
+
digits = price.to_s.rjust(5, "0").split("").map(&:to_i)
|
203
202
|
sum = 0
|
204
203
|
sum += WEIGHT_FACTOR_5plus[digits[0]]
|
205
204
|
sum += WEIGHT_FACTOR_2[digits[1]]
|
@@ -215,7 +214,7 @@ module UpcTools
|
|
215
214
|
# maps as A BCDEFG H
|
216
215
|
# ABC and H never change
|
217
216
|
|
218
|
-
#position conversions
|
217
|
+
# position conversions
|
219
218
|
# G = 0 XXNNN0 A + BC000-00DEF + H
|
220
219
|
# G = 1 XXNNN1 A + BC100-00DEF + H
|
221
220
|
# G = 2 XXNNN2 A + BC200-00DEF + H
|
@@ -227,63 +226,62 @@ module UpcTools
|
|
227
226
|
# G = 8 XXXXX8 A + BCDEF-00008 + H
|
228
227
|
# G = 9 XXXXX9 A + BCDEF-00009 + H
|
229
228
|
|
230
|
-
#Convert short (8 digit) UPC-E to 12 digit UPC-A
|
229
|
+
# Convert short (8 digit) UPC-E to 12 digit UPC-A
|
231
230
|
# @see http://www.taltech.com/barcodesoftware/symbologies/upc
|
232
231
|
# @see http://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E
|
233
232
|
# @param upc_e [String] 8 digit UPC-E to convert
|
234
233
|
# @return [String] 12 digit UPC-A
|
235
234
|
def self.convert_upce_to_upca(upc_e)
|
236
|
-
#todo should i zero pad upc_e?
|
237
|
-
#todo allow without check digit?
|
235
|
+
# todo should i zero pad upc_e?
|
236
|
+
# todo allow without check digit?
|
238
237
|
upc_e = upc_e.to_s
|
239
238
|
raise ArgumentError, "UPC-E must be 8 digits" unless upc_e.size == 8
|
240
239
|
|
241
|
-
map_id = upc_e[-2].to_i #G
|
242
|
-
chk = upc_e[-1] #H
|
243
|
-
prefix = upc_e[0,3] #ABC
|
244
|
-
prefix_next = upc_e[3,3] #DEF
|
240
|
+
map_id = upc_e[-2].to_i # G
|
241
|
+
chk = upc_e[-1] # H
|
242
|
+
prefix = upc_e[0, 3] # ABC
|
243
|
+
prefix_next = upc_e[3, 3] # DEF
|
245
244
|
|
246
245
|
if map_id >= 5
|
247
246
|
"#{prefix}#{prefix_next}0000#{map_id}#{chk}"
|
248
247
|
elsif map_id <= 2
|
249
248
|
"#{prefix}#{map_id}0000#{prefix_next}#{chk}"
|
250
249
|
elsif map_id == 3
|
251
|
-
"#{prefix}#{upc_e[3]}00000#{upc_e[4,2]}#{chk}"
|
250
|
+
"#{prefix}#{upc_e[3]}00000#{upc_e[4, 2]}#{chk}"
|
252
251
|
elsif map_id == 4
|
253
|
-
"#{prefix}#{upc_e[3,2]}00000#{upc_e[5]}#{chk}"
|
252
|
+
"#{prefix}#{upc_e[3, 2]}00000#{upc_e[5]}#{chk}"
|
254
253
|
end
|
255
254
|
end
|
256
255
|
|
257
|
-
#Convert (zero-suppress) 12 digit UPC-A to 8 digit UPC-E
|
256
|
+
# Convert (zero-suppress) 12 digit UPC-A to 8 digit UPC-E
|
258
257
|
# @see http://www.taltech.com/barcodesoftware/symbologies/upc
|
259
258
|
# @see http://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E
|
260
259
|
# @see http://www.barcodeisland.com/upce.phtml#Conversion
|
261
260
|
# @param upc_a [String] 12 digit UPC-A to convert
|
262
261
|
# @return [String] 8 digit UPC-E
|
263
262
|
def self.convert_upca_to_upce(upc_a)
|
264
|
-
#todo should i zero pad upc_a?
|
265
|
-
#todo allow without check digit?
|
263
|
+
# todo should i zero pad upc_a?
|
264
|
+
# todo allow without check digit?
|
266
265
|
upc_a = upc_a.to_s
|
267
266
|
raise ArgumentError, "Must be 12 characters long" unless upc_a.size == 12
|
268
|
-
start = upc_a[0] #first char
|
267
|
+
start = upc_a[0] # first char
|
269
268
|
raise ArgumentError, "Must be type 0 or 1" unless ["0", "1"].include?(start)
|
270
269
|
|
271
|
-
chk = upc_a[-1] #last char
|
272
|
-
mfr = upc_a[1...6] #next 5 characters
|
273
|
-
prod = upc_a[6...11] #last 4 characters w/o chk
|
274
|
-
|
275
|
-
upc_e = if ["000", "100", "200"].include?(mfr[-3,3])
|
276
|
-
"#{mfr[0,2]}#{prod[-3,3]}#{mfr[2]}"
|
277
|
-
elsif mfr[-2,2] ==
|
278
|
-
"#{mfr[0,3]}#{prod[-2,2]}3"
|
279
|
-
elsif mfr[-1] ==
|
280
|
-
"#{mfr[0,4]}#{prod[-1]}4"
|
281
|
-
elsif mfr[-1] !=
|
270
|
+
chk = upc_a[-1] # last char
|
271
|
+
mfr = upc_a[1...6] # next 5 characters
|
272
|
+
prod = upc_a[6...11] # last 4 characters w/o chk
|
273
|
+
|
274
|
+
upc_e = if ["000", "100", "200"].include?(mfr[-3, 3])
|
275
|
+
"#{mfr[0, 2]}#{prod[-3, 3]}#{mfr[2]}"
|
276
|
+
elsif mfr[-2, 2] == "00" && prod.to_i <= 99
|
277
|
+
"#{mfr[0, 3]}#{prod[-2, 2]}3"
|
278
|
+
elsif mfr[-1] == "0" && prod.to_i <= 9
|
279
|
+
"#{mfr[0, 4]}#{prod[-1]}4"
|
280
|
+
elsif mfr[-1] != "0" && [5, 6, 7, 8, 9].include?(prod.to_i)
|
282
281
|
"#{mfr}#{prod[-1]}"
|
283
282
|
end
|
284
283
|
raise ArgumentError, "Must meet formatting requirements" unless upc_e
|
285
284
|
|
286
285
|
"#{start}#{upc_e}#{chk}"
|
287
286
|
end
|
288
|
-
|
289
287
|
end
|
data/lib/upc_tools/version.rb
CHANGED
data/upc_tools.gemspec
CHANGED
@@ -1,25 +1,22 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
3
|
+
require "upc_tools/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
14
|
-
spec.
|
6
|
+
spec.name = "upc_tools"
|
7
|
+
spec.version = UpcTools::VERSION
|
8
|
+
spec.authors = ["Justin Hart", "Ibotta, Inc."]
|
9
|
+
spec.email = ["jhart@ibotta.com"]
|
10
|
+
spec.summary = "UPC validation and creation utilities"
|
11
|
+
spec.description = "create, validate, convert UPCs"
|
12
|
+
spec.homepage = "https://github.com/Ibotta/ruby_upc_tools"
|
13
|
+
spec.licenses = ["Apache-2.0"]
|
15
14
|
|
16
|
-
spec.files
|
17
|
-
spec.bindir
|
18
|
-
spec.executables
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.bindir = "exe"
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
18
|
spec.require_paths = ["lib"]
|
20
19
|
|
21
|
-
spec.add_development_dependency "
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
20
|
+
spec.add_development_dependency "rake"
|
23
21
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
-
spec.add_development_dependency "yard"
|
25
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upc_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Hart
|
@@ -9,36 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.12'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.12'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rake
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
31
17
|
requirements:
|
32
|
-
- - "
|
18
|
+
- - ">="
|
33
19
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
20
|
+
version: '0'
|
35
21
|
type: :development
|
36
22
|
prerelease: false
|
37
23
|
version_requirements: !ruby/object:Gem::Requirement
|
38
24
|
requirements:
|
39
|
-
- - "
|
25
|
+
- - ">="
|
40
26
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
27
|
+
version: '0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: rspec
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,20 +39,6 @@ dependencies:
|
|
53
39
|
- - "~>"
|
54
40
|
- !ruby/object:Gem::Version
|
55
41
|
version: '3.0'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: yard
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
42
|
description: create, validate, convert UPCs
|
71
43
|
email:
|
72
44
|
- jhart@ibotta.com
|
@@ -74,12 +46,13 @@ executables: []
|
|
74
46
|
extensions: []
|
75
47
|
extra_rdoc_files: []
|
76
48
|
files:
|
49
|
+
- ".github/ISSUE_TEMPLATE.md"
|
50
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
77
51
|
- ".gitignore"
|
78
52
|
- ".rspec"
|
79
53
|
- ".travis.yml"
|
80
54
|
- CODE_OF_CONDUCT.md
|
81
55
|
- Gemfile
|
82
|
-
- Gemfile.lock
|
83
56
|
- Guardfile
|
84
57
|
- LICENSE
|
85
58
|
- README.md
|
@@ -91,7 +64,7 @@ files:
|
|
91
64
|
- upc_tools.gemspec
|
92
65
|
homepage: https://github.com/Ibotta/ruby_upc_tools
|
93
66
|
licenses:
|
94
|
-
-
|
67
|
+
- Apache-2.0
|
95
68
|
metadata: {}
|
96
69
|
post_install_message:
|
97
70
|
rdoc_options: []
|
@@ -108,10 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
81
|
- !ruby/object:Gem::Version
|
109
82
|
version: '0'
|
110
83
|
requirements: []
|
111
|
-
|
112
|
-
rubygems_version: 2.2.5
|
84
|
+
rubygems_version: 3.0.3
|
113
85
|
signing_key:
|
114
86
|
specification_version: 4
|
115
87
|
summary: UPC validation and creation utilities
|
116
88
|
test_files: []
|
117
|
-
has_rdoc:
|