vindetta 0.14.0 → 0.15.0

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: 16699916d3e179d310348f240ddcb65987e1f77f
4
- data.tar.gz: 67b453f4cdafe2dff958fa1fedbb4d529fb60fe1
3
+ metadata.gz: a3900e8e738013d538a9ad3640ed2fce1d2dd0d4
4
+ data.tar.gz: fa7efc3df758cf3dc570db2d96866f47b606f14c
5
5
  SHA512:
6
- metadata.gz: 700540d56215f8d61516bdfc5642eb79505ce2d1ba57c49fe7ce4a4cfa48d54f9e86fd1ae90ab54bf2f0550ea70b349be0546781e444fa4a01a02d2eda4c8433
7
- data.tar.gz: 488d7c06fa36c316b6a4447dcb4c51e582c4a6f8b0dcdb0d000372a2285b8dd8964e0df43db56da2e54ddcfe083cce9f2a83bc9790b5b5265c93ff4029c787c8
6
+ metadata.gz: 5a5040aa6110a0c377317820296587847c2f681af4b530038f1f196cfc9f612e74f6c7a558fc932df0fc20c9e22a972d7549efb96179cdd13041185b178f2746
7
+ data.tar.gz: bac8e88bfc0e74ccd1f52e4909e3f356b684c45ab3f828f603f6567b7913559f5230510bff1fe48a70d490f056a0755e4408f806edab3e31b153e1088b7a47db
data/lib/vindetta/cli.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require "gli"
2
2
  require "vindetta/version"
3
- require "pp"
3
+ require "i18n"
4
+
5
+ I18n.load_path << Dir["./lib/vindetta/locale/*.yml"]
6
+ I18n.backend.load_translations
4
7
 
5
8
  module Vindetta
6
9
  class CLI
@@ -8,9 +11,11 @@ module Vindetta
8
11
 
9
12
  program_desc "Vehicle Identification Number (VIN) CLI"
10
13
  version Vindetta::VERSION
14
+ error_device = error_device
11
15
 
12
16
  desc "Transliterates a VIN character"
13
17
  arg_name "character"
18
+
14
19
  command %i[transliterate t] do |c|
15
20
  c.action do |_global, _options, args|
16
21
  puts Vindetta::Transliterator.run(args.first)
@@ -18,24 +23,33 @@ module Vindetta
18
23
  end
19
24
 
20
25
  desc "Validates a VIN"
26
+
21
27
  command %i[validate v] do |c|
22
28
  c.action do |_global, _options, args|
23
- puts Vindetta::Validator.run(args.first)
29
+ vin = args.first
30
+
31
+ exit_now!(I18n.t("required"), 1) if vin.nil?
32
+
33
+ valid = Vindetta::Validator.run(vin)
34
+
35
+ puts valid ? 1 : 0
24
36
  end
25
37
  end
26
38
 
27
39
  desc "Decodes a VIN"
40
+
28
41
  command %i[decode d] do |c|
29
- c.action do |_global, _options, _args|
30
- vin = _args.first
42
+ c.action do |_global, _options, args|
43
+ vin = args.first
31
44
 
32
- exit_now!("vin is required") if vin.nil?
45
+ exit_now!(I18n.t("required"), 1) if vin.nil?
33
46
 
34
47
  puts Vindetta::Decoder.decode_vin(vin).to_json
35
48
  end
36
49
  end
37
50
 
38
51
  desc "Generates a random VIN"
52
+
39
53
  command %i[generate g] do |c|
40
54
  c.action do |_global, _options, _args|
41
55
  puts Vindetta::Generator.generate
@@ -25,7 +25,7 @@ module Vindetta
25
25
  end
26
26
 
27
27
  def inspect
28
- "#<Vindetta::Decoder::Response:#{"0x00%x" % (object_id << 1)}>"
28
+ "#<Vindetta::Decoder::Response:#{format('0x00%x', (object_id << 1))}>"
29
29
  end
30
30
 
31
31
  def to_json
@@ -2,7 +2,7 @@ require "net/http"
2
2
 
3
3
  module Vindetta
4
4
  class Generator
5
- def self.generate(options = {})
5
+ def self.generate(_options = {})
6
6
  Net::HTTP.get("randomvin.com", "/getvin.php")
7
7
  end
8
8
  end
@@ -1,2 +1,3 @@
1
1
  en:
2
+ required: "vin is required"
2
3
  invalid_length: "Invalid Length"
@@ -1,3 +1,3 @@
1
1
  module Vindetta
2
- VERSION = "0.14.0".freeze
2
+ VERSION = "0.15.0".freeze
3
3
  end
data/vindetta.gemspec CHANGED
@@ -25,16 +25,16 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "activemodel", "~> 5.1"
26
26
  spec.add_dependency "activesupport", "~> 5.1"
27
27
  spec.add_dependency "gli", "~> 2.16"
28
- spec.add_dependency "i18n", "~> 0.8.6"
28
+ spec.add_dependency "i18n", "~> 0.9.1"
29
29
  spec.add_dependency "httparty", "~> 0.15.6"
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 1.14"
32
- spec.add_development_dependency "factory_girl", "~> 4.8.0"
32
+ spec.add_development_dependency "factory_bot", "~> 4.8.2"
33
33
  spec.add_development_dependency "guard-rspec", "~> 4.7.3"
34
34
  spec.add_development_dependency "pry", "~> 0.10"
35
- spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "rake", "~> 12.3.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
37
  spec.add_development_dependency "rubocop", "~> 0.49"
38
- spec.add_development_dependency "webmock", "~> 3.0.1"
39
- spec.add_development_dependency "vcr", "~> 3.0.3"
38
+ spec.add_development_dependency "webmock", "~> 3.1.1"
39
+ spec.add_development_dependency "vcr", "~> 4.0.0"
40
40
  end
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.14.0
4
+ version: 0.15.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: 2017-11-13 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.6
61
+ version: 0.9.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.6
68
+ version: 0.9.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: httparty
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.14'
97
97
  - !ruby/object:Gem::Dependency
98
- name: factory_girl
98
+ name: factory_bot
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 4.8.0
103
+ version: 4.8.2
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 4.8.0
110
+ version: 4.8.2
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: guard-rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '10.0'
145
+ version: 12.3.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '10.0'
152
+ version: 12.3.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -184,28 +184,28 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 3.0.1
187
+ version: 3.1.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 3.0.1
194
+ version: 3.1.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: vcr
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 3.0.3
201
+ version: 4.0.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 3.0.3
208
+ version: 4.0.0
209
209
  description: Ruby gem for generating VINs
210
210
  email:
211
211
  - kyle@joinroot.com