jan 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08c3cfeccb0e7c251771a361c3a06fcd54b98937
4
- data.tar.gz: c20f6fd40652e7dbe919637f0d267fd6bc5fc394
3
+ metadata.gz: 0d6313bab8b0a5c015d808a26faa9d0630962a89
4
+ data.tar.gz: f3f60ad255e4433f22f9a226e7ff91e50788c641
5
5
  SHA512:
6
- metadata.gz: 6e9eae526ddf5131d130e4f53063734c79cde4c504941c5112308718a24cbb56aeb6585356313a621bb9786c82d58c8749f0dcf4a2088cb4b6a8d59cb1bb55e4
7
- data.tar.gz: 3187307e507e10caf0e8107cec9905829206ab037840e5601ad6a7c689d5b3b8388c07b3ab8c509dbe4dd000790349fb2605abe400976cf2cbeca6ad2b84cae3
6
+ metadata.gz: 849860dd769589918d645146a251e29c04b0ba46b9fe4209259df1ba76f3c99e4a4c79e54fd09806ccbd662378d52f467527b190fbe8ff32ec214dcfa12672d4
7
+ data.tar.gz: 662460f600db6d8529c0b4c5ec25e96a048a37c887278eb165177a9b689a849af4f5f536cd4fd78380ce05b10a3aafb83721e387e8a955d57527ac8e514e90ad
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Jan
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/jan.svg)](http://badge.fury.io/rb/jan)
3
4
  [![Build Status](https://travis-ci.org/s-osa/jan.svg?branch=master)](https://travis-ci.org/s-osa/jan)
4
5
 
5
6
  A small utility for JAN code.
data/lib/jan/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Jan < ::String
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/jan.rb CHANGED
@@ -19,6 +19,10 @@ class Jan < ::String
19
19
  Parser.check_digit(self)
20
20
  end
21
21
 
22
+ def body
23
+ Parser.body(self)
24
+ end
25
+
22
26
  def even_digits
23
27
  Parser.even_digits(self)
24
28
  end
data/spec/jan_spec.rb CHANGED
@@ -31,6 +31,12 @@ describe Jan do
31
31
  it("should return last digit"){ is_expected.to eq(6) }
32
32
  end
33
33
 
34
+ describe "#body" do
35
+ let(:jan){ described_class.new("4901277241126") }
36
+ subject{ jan.body }
37
+ it("should return digits without check digit"){ is_expected.to eq("490127724112") }
38
+ end
39
+
34
40
  describe "#even_digits" do
35
41
  let(:jan){ described_class.new("4901277241126") }
36
42
  subject{ jan.even_digits }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - OSA Shunsuke
@@ -92,7 +92,6 @@ files:
92
92
  - Gemfile
93
93
  - Guardfile
94
94
  - LICENSE
95
- - LICENSE.txt
96
95
  - README.md
97
96
  - Rakefile
98
97
  - jan.gemspec
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
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.