gtiny 0.3.0 → 0.5.0
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/gtiny/encoding.rb +4 -0
- data/lib/gtiny/gtin.rb +4 -0
- data/lib/gtiny/gtin13.rb +3 -2
- data/lib/gtiny/version.rb +1 -1
- data/sig/gtiny/encoding.rbs +2 -0
- data/sig/gtiny/gtin.rbs +4 -0
- metadata +3 -4
- data/gtiny.gemspec +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0eb6b234612e3044908f4ebde7f2ef3d2e956a024a8e953e0ece1f1df20b895e
|
|
4
|
+
data.tar.gz: a0951b74cf605bba726bbbb7e1ffa3613b349b72ab23f27afb4bc9f0cb718d82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57515452c25b3861d7affa1d1b9d9525a93c1a9a23486916dfb5d4330516270ee6e7c88067967281a7c2aa80dcc9d996f13092b79749d54ad0f5ec890797a82b
|
|
7
|
+
data.tar.gz: 0ba9faa3676c154f83e00fb8703e04e4aa38966fa137f597a77bcb77c11813fd05926aeedf2aff33953858c6a10b92f576ec694bd3e19f2cd772fe8807809893
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.5.0] - 2023-08-23
|
|
4
|
+
|
|
5
|
+
- Fix that allows 13 digit strings starting with zeroes to be parsed as GTIN-13s
|
|
6
|
+
|
|
7
|
+
## [0.4.0] - 2023-07-11
|
|
8
|
+
- Add `zeroes?` method to Encoding.
|
|
9
|
+
- Add `digits` method to GTIN.
|
|
10
|
+
|
|
3
11
|
## [0.3.0] - 2023-02-10
|
|
4
12
|
|
|
5
13
|
- Add the ability to strip the indicator digit on GTIN-14s
|
data/Gemfile.lock
CHANGED
data/lib/gtiny/encoding.rb
CHANGED
data/lib/gtiny/gtin.rb
CHANGED
data/lib/gtiny/gtin13.rb
CHANGED
|
@@ -5,9 +5,10 @@ require_relative "gtin"
|
|
|
5
5
|
module Gtiny
|
|
6
6
|
# GTIN-13: Used for EAN-13 barcodes.
|
|
7
7
|
class GTIN13 < GTIN
|
|
8
|
-
# GS1 company prefix starts with 1-9
|
|
8
|
+
# GS1 company prefix starts with 1-9 but we could have a GTIN-12 in GTIN-13
|
|
9
|
+
# format.
|
|
9
10
|
def self.regex
|
|
10
|
-
/\A[
|
|
11
|
+
/\A[0-9]{13}\z/
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def type
|
data/lib/gtiny/version.rb
CHANGED
data/sig/gtiny/encoding.rbs
CHANGED
data/sig/gtiny/gtin.rbs
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gtiny
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Clayton Passmore
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|
|
@@ -27,7 +27,6 @@ files:
|
|
|
27
27
|
- README.md
|
|
28
28
|
- Rakefile
|
|
29
29
|
- Steepfile
|
|
30
|
-
- gtiny.gemspec
|
|
31
30
|
- lib/gtiny.rb
|
|
32
31
|
- lib/gtiny/check_digit_calculators.rb
|
|
33
32
|
- lib/gtiny/converters.rb
|
|
@@ -83,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
83
82
|
- !ruby/object:Gem::Version
|
|
84
83
|
version: '0'
|
|
85
84
|
requirements: []
|
|
86
|
-
rubygems_version: 3.
|
|
85
|
+
rubygems_version: 3.4.6
|
|
87
86
|
signing_key:
|
|
88
87
|
specification_version: 4
|
|
89
88
|
summary: A tiny gem for identifying and validating GTINs in the wild.
|
data/gtiny.gemspec
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "lib/gtiny/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = "gtiny"
|
|
7
|
-
spec.version = Gtiny::VERSION
|
|
8
|
-
spec.authors = ["Clayton Passmore"]
|
|
9
|
-
spec.email = ["clayton@juniphq.com"]
|
|
10
|
-
|
|
11
|
-
spec.summary = "A tiny gem for identifying and validating GTINs in the wild."
|
|
12
|
-
spec.homepage = "https://github.com/junip-inc/gtiny"
|
|
13
|
-
spec.license = "MIT"
|
|
14
|
-
spec.required_ruby_version = ">= 3.0.0"
|
|
15
|
-
|
|
16
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
17
|
-
spec.metadata["rubygems_mfa_required"] = "true"
|
|
18
|
-
|
|
19
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
|
20
|
-
spec.metadata["source_code_uri"] = spec.homepage
|
|
21
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
22
|
-
|
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
25
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
26
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
27
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
spec.bindir = "exe"
|
|
31
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
32
|
-
spec.require_paths = ["lib"]
|
|
33
|
-
|
|
34
|
-
# Uncomment to register a new dependency of your gem
|
|
35
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
|
36
|
-
|
|
37
|
-
# For more information and examples about making a new gem, check out our
|
|
38
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
|
39
|
-
end
|