vindetta 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/lib/vindetta/calculator.rb +7 -1
- data/lib/vindetta/validator.rb +2 -0
- data/lib/vindetta/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 431f60cb9e88b478d17ac6364e430add13aae1aa
|
4
|
+
data.tar.gz: 744ed0e12ac60ca9d2ec5f099120a82b1c702c2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be530f83c70f9d5ca9626596e0b01ee2760da8981fc9ea2a2d0ecd02ab462c3615c01fa87497dc886a5d2ea5b6f1e5823cf05419305fcf9999adb377e2f13e36
|
7
|
+
data.tar.gz: 824a3482af1ace05096c5742f8266c46323fb62911230acc79268b829b29e31325ead79b8a92825027c95edb66eed5e86e8c2cff2127cc519a9d61678985dde0
|
data/README.md
CHANGED
@@ -29,18 +29,17 @@ SYNOPSIS
|
|
29
29
|
vindetta [global options] command [command options] [arguments...]
|
30
30
|
|
31
31
|
VERSION
|
32
|
-
0.
|
32
|
+
0.22.0
|
33
33
|
|
34
34
|
GLOBAL OPTIONS
|
35
35
|
--help - Show this message
|
36
36
|
--version - Display the program version
|
37
37
|
|
38
38
|
COMMANDS
|
39
|
-
decode, d
|
40
|
-
generate, g
|
41
|
-
help
|
42
|
-
|
43
|
-
validate, v - Validates a VIN
|
39
|
+
decode, d - Decodes a VIN
|
40
|
+
generate, g - Generates a random VIN
|
41
|
+
help - Shows a list of commands or help for one command
|
42
|
+
validate, v - Validates a VIN
|
44
43
|
```
|
45
44
|
|
46
45
|
## Development
|
data/lib/vindetta/calculator.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
module Vindetta
|
2
2
|
class Calculator
|
3
|
+
InvalidCharacterError = Class.new(StandardError)
|
4
|
+
|
3
5
|
def self.check_digit(vin)
|
4
6
|
transliterator = -> (c) do
|
5
|
-
"0123456789.ABCDEFGH..JKLMN.P.R..STUVWXYZ".chars.index(c)
|
7
|
+
index = "0123456789.ABCDEFGH..JKLMN.P.R..STUVWXYZ".chars.index(c)
|
8
|
+
|
9
|
+
raise InvalidCharacterError if index.nil?
|
10
|
+
|
11
|
+
index % 10
|
6
12
|
end
|
7
13
|
|
8
14
|
summer = -> (sum, (a, b)) do
|
data/lib/vindetta/validator.rb
CHANGED
data/lib/vindetta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vindetta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Decot
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|