nitv 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c93a24802b7327e9a957e51ab4093886a44accd
4
- data.tar.gz: b8bf2707bcd3faf6c62005d6fcd36eae5355e162
3
+ metadata.gz: b42fed3454529eb746310a496e09059548d6b54a
4
+ data.tar.gz: b2cdd28b5e096e618cd33d51767a969ef3c59f84
5
5
  SHA512:
6
- metadata.gz: e92531653a30549188e36d94d979407cb6193e83513b1173b6084f5b898e51fde94dd818e3e5e3c86c46ef80bcfb35f0182f4314d89f83d948d8c29eb7e808e7
7
- data.tar.gz: 01a625be00ed6577826e95f97612ee835a488bdf28c9eb30364d68d8af1fcaa0f6742e17ff387265179b09b858d022ba3fecd9f9a2b5ddbf2701bc460bcc639d
6
+ metadata.gz: 640777d51791a97c6818885e46eb5fabfc63d7fc77219da7cc2df84cc4e93e74b7870d349a7a11a52176ded8ffd9fb93bff7ac6fc5b41e72027d9d4fc736177f
7
+ data.tar.gz: be651dbde8259073c9f032b0cdab5101edc729faac205f990b5d220054da3fc15986434c363bb3cfd0bd5db1dfe7b0a212a6068fd37e7d29f45c1a25d18b8111
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+
11
+ *.gem
@@ -2,7 +2,8 @@ require "nitv/version"
2
2
 
3
3
  module Nitv
4
4
  def self.is_valid?(nit)
5
- raise Nitv::NitFormatError, "format should be e.g 1234567-8" unless /^[0-9]+-[0-9k]$/ =~ nit
5
+ raise Nitv::NitTypeError, "nit should be a string" unless nit.class == String
6
+ raise Nitv::NitFormatError, "nit format should be xxxxxx-x" unless /^[0-9]+-[0-9k]$/ =~ nit
6
7
 
7
8
  nums = nit[0, nit.index("-")].chars
8
9
  checker = nit.chars.last == "k" ? 10 : nit.chars.last.to_i
@@ -20,4 +21,7 @@ module Nitv
20
21
 
21
22
  class NitFormatError < StandardError
22
23
  end
24
+
25
+ class NitTypeError < StandardError
26
+ end
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module Nitv
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nitv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bronzdoc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler