jan 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/Guardfile +6 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +78 -0
- data/Rakefile +7 -0
- data/jan.gemspec +26 -0
- data/lib/jan/check_digit_calculator.rb +13 -0
- data/lib/jan/parser.rb +25 -0
- data/lib/jan/random.rb +23 -0
- data/lib/jan/validator.rb +14 -0
- data/lib/jan/version.rb +3 -0
- data/lib/jan.rb +35 -0
- data/spec/jan/check_digit_calculator_spec.rb +15 -0
- data/spec/jan/parser_spec.rb +49 -0
- data/spec/jan/random_spec.rb +41 -0
- data/spec/jan/validator_spec.rb +23 -0
- data/spec/jan_spec.rb +67 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/support/invalid_codes.rb +8 -0
- data/spec/support/valid_codes.rb +9 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ebad61806458a86c36f94a97d38b74ccb93f45c4
|
4
|
+
data.tar.gz: 7724c79d26b5bdb8a4154d0a809f29f21a858cc7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 053b3a6c5784718be8f10a6d79f9e14af43fa6974ce34547f86defb8f4c735a185f40a5e20e89c22b8ff340970e277ee5b86752d7667299cf6d623c52c78ceda
|
7
|
+
data.tar.gz: 28adbb792d78c7152dcf1daf6bb6f7bd8afc4fa45bd628808616881fab69cb298675d0f268a4f24d7286b3c46632f2a2d9ee23876e2cdf7b84981a54aca7d34a
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.rspec
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 OSA Shunsuke
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 OSA Shunsuke
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Jan
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/s-osa/jan.svg?branch=master)](https://travis-ci.org/s-osa/jan)
|
4
|
+
|
5
|
+
A small utility for JAN code.
|
6
|
+
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'jan'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
```sh
|
19
|
+
$ bundle
|
20
|
+
```
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
```sh
|
25
|
+
$ gem install jan
|
26
|
+
```
|
27
|
+
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
### Basic usage
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
jan = Jan.new("4901277241126")
|
35
|
+
jan.valid? # => true
|
36
|
+
|
37
|
+
Jan::Validator.validate("4901277241126") # => true
|
38
|
+
```
|
39
|
+
|
40
|
+
### Get elements
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
jan = Jan.new("4901277241126")
|
44
|
+
jan.check_digit # => 6
|
45
|
+
jan.body # => "490127724112"
|
46
|
+
|
47
|
+
Jan::Parser.check_digit("4901277241126") # => 6
|
48
|
+
Jan::Parser.body("4901277241126") # => "490127724112"
|
49
|
+
```
|
50
|
+
|
51
|
+
### Distinct in-store code
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
jan = Jan.new("4901277241126")
|
55
|
+
jan.instore_code? # => false
|
56
|
+
|
57
|
+
Jan::Paser.instore_code?("2163179230340") # => true
|
58
|
+
```
|
59
|
+
|
60
|
+
### Generate random code
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
Jan::Random.code # => "5689450935688"
|
64
|
+
Jan::Random.code(8) # => "11774853"
|
65
|
+
|
66
|
+
Jan::Random.instore_code # => "2799375754394"
|
67
|
+
Jan::Random.instore_code(8) # => "27393086"
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
## Contributing
|
73
|
+
|
74
|
+
1. Fork it ( https://github.com/[my-github-username]/jan/fork )
|
75
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
76
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
77
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
78
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/jan.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jan/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jan"
|
8
|
+
spec.version = Jan::VERSION
|
9
|
+
spec.authors = ["OSA Shunsuke"]
|
10
|
+
spec.email = ["hhelibebcnofnenamg@gmail.com"]
|
11
|
+
spec.summary = %q{JAN utility gem}
|
12
|
+
spec.description = %q{JAN utility gem}
|
13
|
+
spec.homepage = "https://github.com/s-osa/jan"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "guard"
|
25
|
+
spec.add_development_dependency "guard-rspec"
|
26
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "jan/parser"
|
2
|
+
|
3
|
+
class Jan
|
4
|
+
module CheckDigitCalculator
|
5
|
+
module_function
|
6
|
+
|
7
|
+
def calculate(body)
|
8
|
+
code = body.to_s + "x"
|
9
|
+
digit = 10 - (Parser.even_digits(code).reduce(&:+) * 3 + Parser.odd_digits(code).reduce(&:+)) % 10
|
10
|
+
digit % 10
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/jan/parser.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
class Jan
|
2
|
+
module Parser
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def check_digit(code)
|
6
|
+
code[-1].to_i
|
7
|
+
end
|
8
|
+
|
9
|
+
def body(code)
|
10
|
+
code[0..-2]
|
11
|
+
end
|
12
|
+
|
13
|
+
def even_digits(code)
|
14
|
+
code.split('').reverse.map(&:to_i).select.with_index(1){|_d, index| index.even? }.reverse
|
15
|
+
end
|
16
|
+
|
17
|
+
def odd_digits(code)
|
18
|
+
code.split('').reverse.map(&:to_i).select.with_index(1){|_d, index| index.odd? }.reverse[0..-2]
|
19
|
+
end
|
20
|
+
|
21
|
+
def instore_code?(code)
|
22
|
+
InstorePrefixes.include?(code[0..1])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/jan/random.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "jan/parser"
|
2
|
+
require "jan/check_digit_calculator"
|
3
|
+
|
4
|
+
class Jan
|
5
|
+
module Random
|
6
|
+
module_function
|
7
|
+
|
8
|
+
Digits = %w(1 2 3 4 5 6 7 8 9 0)
|
9
|
+
|
10
|
+
def code(size=13)
|
11
|
+
build(size)
|
12
|
+
end
|
13
|
+
|
14
|
+
def instore_code(size=13)
|
15
|
+
build(size - 2, InstorePrefixes.sample)
|
16
|
+
end
|
17
|
+
|
18
|
+
def build(size, code="")
|
19
|
+
size.times{ code += Digits.sample }
|
20
|
+
Parser.body(code) + CheckDigitCalculator.calculate(Parser.body(code)).to_s
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "jan/parser"
|
2
|
+
require "jan/check_digit_calculator"
|
3
|
+
|
4
|
+
class Jan
|
5
|
+
module Validator
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def validate(code)
|
9
|
+
code = code.to_s
|
10
|
+
return false unless [8,13].include?(code.size)
|
11
|
+
Parser.check_digit(code) == CheckDigitCalculator.calculate(Parser.body(code))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/jan/version.rb
ADDED
data/lib/jan.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "jan/version"
|
2
|
+
require "jan/parser"
|
3
|
+
require "jan/check_digit_calculator"
|
4
|
+
require "jan/validator"
|
5
|
+
require "jan/random"
|
6
|
+
|
7
|
+
class Jan
|
8
|
+
InstorePrefixes = %w(02 20 21 22 23 24 25 26 27 28 29)
|
9
|
+
|
10
|
+
attr_accessor :code
|
11
|
+
|
12
|
+
def initialize(code)
|
13
|
+
@code = code
|
14
|
+
end
|
15
|
+
|
16
|
+
def valid?
|
17
|
+
Validator.validate(@code)
|
18
|
+
end
|
19
|
+
|
20
|
+
def check_digit
|
21
|
+
Parser.check_digit(@code)
|
22
|
+
end
|
23
|
+
|
24
|
+
def even_digits
|
25
|
+
Parser.even_digits(@code)
|
26
|
+
end
|
27
|
+
|
28
|
+
def odd_digits
|
29
|
+
Parser.odd_digits(@code)
|
30
|
+
end
|
31
|
+
|
32
|
+
def instore_code?
|
33
|
+
Parser.instore_code?(@code)
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jan::CheckDigitCalculator do
|
4
|
+
describe ".calculate" do
|
5
|
+
it "should return check digit" do
|
6
|
+
actual = Jan::CheckDigitCalculator.calculate("490127724112")
|
7
|
+
expect(actual).to eq(6)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return 0 as check digit" do
|
11
|
+
actual = Jan::CheckDigitCalculator.calculate("490330111020")
|
12
|
+
expect(actual).to eq(0)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jan::Parser do
|
4
|
+
let(:code){ "1234567890123" }
|
5
|
+
|
6
|
+
describe ".check_digit(code)" do
|
7
|
+
it "should return last digit" do
|
8
|
+
actual = Jan::Parser.check_digit(code)
|
9
|
+
expect(actual).to eq(3)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe ".body(code)" do
|
14
|
+
it "should return string except last digit" do
|
15
|
+
actual = Jan::Parser.body(code)
|
16
|
+
expect(actual).to eq("123456789012")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe ".even_digits(code)" do
|
21
|
+
it "should return digits in even number-th position" do
|
22
|
+
actual = Jan::Parser.even_digits(code)
|
23
|
+
expect(actual).to eq([2,4,6,8,0,2])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe ".odd_digits(code)" do
|
28
|
+
it "should return digits in odd number-th position except check_digit" do
|
29
|
+
actual = Jan::Parser.odd_digits(code)
|
30
|
+
expect(actual).to eq([1,3,5,7,9,1])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe ".instore_code?(code)" do
|
35
|
+
context "instore code" do
|
36
|
+
it "should be true" do
|
37
|
+
actual = Jan::Parser.instore_code?("2101085089347")
|
38
|
+
expect(actual).to be true
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "global code" do
|
43
|
+
it "should be false" do
|
44
|
+
actual = Jan::Parser.instore_code?("4901085089347")
|
45
|
+
expect(actual).to be false
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jan::Random do
|
4
|
+
describe ".code(size)" do
|
5
|
+
(6..20).each do |size|
|
6
|
+
it "should return code with valid check digit" do
|
7
|
+
code = Jan::Random.code(size)
|
8
|
+
check_digit = Jan::Parser.check_digit(code)
|
9
|
+
actual = Jan::CheckDigitCalculator.calculate(Jan::Parser.body(code))
|
10
|
+
expect(actual).to eq(check_digit)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return given length valid code" do
|
14
|
+
code = Jan::Random.code(size)
|
15
|
+
expect(code.size).to eq(size)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe ".instore_code(size)" do
|
21
|
+
(6..20).each do |size|
|
22
|
+
it "should return code with valid check digit" do
|
23
|
+
code = Jan::Random.instore_code(size)
|
24
|
+
check_digit = Jan::Parser.check_digit(code)
|
25
|
+
actual = Jan::CheckDigitCalculator.calculate(Jan::Parser.body(code))
|
26
|
+
expect(actual).to eq(check_digit)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should return instore code" do
|
30
|
+
code = Jan::Random.instore_code(size)
|
31
|
+
actual = Jan::Parser.instore_code?(code)
|
32
|
+
expect(actual).to be true
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should return given length valid code" do
|
36
|
+
code = Jan::Random.instore_code(size)
|
37
|
+
expect(code.size).to eq(size)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jan::Validator do
|
4
|
+
describe ".validate" do
|
5
|
+
context "valid codes" do
|
6
|
+
valid_codes.each do |code|
|
7
|
+
it "#{code} should be valid" do
|
8
|
+
actual = Jan::Validator.validate(code)
|
9
|
+
expect(actual).to be true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "invalid codes" do
|
15
|
+
invalid_codes.each do |code|
|
16
|
+
it "#{code} should be invalid" do
|
17
|
+
actual = Jan::Validator.validate(code)
|
18
|
+
expect(actual).to be false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/jan_spec.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Jan do
|
4
|
+
describe "#valid?" do
|
5
|
+
context "valid codes" do
|
6
|
+
valid_codes.each do |code|
|
7
|
+
it "#{code} should be valid" do
|
8
|
+
jan = Jan.new(code)
|
9
|
+
expect(jan.valid?).to be true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "invalid codes" do
|
15
|
+
invalid_codes.each do |code|
|
16
|
+
it "#{code} should be invalid" do
|
17
|
+
jan = Jan.new(code)
|
18
|
+
expect(jan.valid?).to be false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#check_digit" do
|
25
|
+
it "should return last digit" do
|
26
|
+
jan = Jan.new("4901277241126")
|
27
|
+
expect(jan.check_digit).to eq(6)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#even_digits" do
|
32
|
+
it "should return digits in even number-th position" do
|
33
|
+
jan = Jan.new("4901277241126")
|
34
|
+
expect(jan.even_digits).to eq([9,1,7,2,1,2])
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "#odd_digits" do
|
39
|
+
it "should return digits in odd number-th position except check digit" do
|
40
|
+
jan = Jan.new("4901277241126")
|
41
|
+
expect(jan.odd_digits).to eq([4,0,2,7,4,1])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "#instore_code?" do
|
46
|
+
it "should return digits in odd number-th position except check digit" do
|
47
|
+
jan = Jan.new("4901277241126")
|
48
|
+
expect(jan.odd_digits).to eq([4,0,2,7,4,1])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "#instore_code?" do
|
53
|
+
context "instore code" do
|
54
|
+
it "should be true" do
|
55
|
+
jan = Jan.new("2101085089347")
|
56
|
+
expect(jan).to be_instore_code
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context "global code" do
|
61
|
+
it "should be false" do
|
62
|
+
jan = Jan.new("4901085089347")
|
63
|
+
expect(jan).not_to be_instore_code
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- OSA Shunsuke
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: JAN utility gem
|
84
|
+
email:
|
85
|
+
- hhelibebcnofnenamg@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
|
+
- Gemfile
|
93
|
+
- Guardfile
|
94
|
+
- LICENSE
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- jan.gemspec
|
99
|
+
- lib/jan.rb
|
100
|
+
- lib/jan/check_digit_calculator.rb
|
101
|
+
- lib/jan/parser.rb
|
102
|
+
- lib/jan/random.rb
|
103
|
+
- lib/jan/validator.rb
|
104
|
+
- lib/jan/version.rb
|
105
|
+
- spec/jan/check_digit_calculator_spec.rb
|
106
|
+
- spec/jan/parser_spec.rb
|
107
|
+
- spec/jan/random_spec.rb
|
108
|
+
- spec/jan/validator_spec.rb
|
109
|
+
- spec/jan_spec.rb
|
110
|
+
- spec/spec_helper.rb
|
111
|
+
- spec/support/invalid_codes.rb
|
112
|
+
- spec/support/valid_codes.rb
|
113
|
+
homepage: https://github.com/s-osa/jan
|
114
|
+
licenses:
|
115
|
+
- MIT
|
116
|
+
metadata: {}
|
117
|
+
post_install_message:
|
118
|
+
rdoc_options: []
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
requirements: []
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 2.2.2
|
134
|
+
signing_key:
|
135
|
+
specification_version: 4
|
136
|
+
summary: JAN utility gem
|
137
|
+
test_files:
|
138
|
+
- spec/jan/check_digit_calculator_spec.rb
|
139
|
+
- spec/jan/parser_spec.rb
|
140
|
+
- spec/jan/random_spec.rb
|
141
|
+
- spec/jan/validator_spec.rb
|
142
|
+
- spec/jan_spec.rb
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/support/invalid_codes.rb
|
145
|
+
- spec/support/valid_codes.rb
|