vindetta 0.5.0 → 0.6.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: f3327dc72e9a48d3267b48c38f102cf077d43a6a
4
- data.tar.gz: 7fc1ae55b03280a99511a6de3ecb7e3bad7c32e9
3
+ metadata.gz: 116289faa3a0129f9e29570b59c210a82e75e9a7
4
+ data.tar.gz: a293cb4c27e424b7ab8cd0464ccfbeead07ad8a4
5
5
  SHA512:
6
- metadata.gz: 4204bafb056991e3868bbb9b852f72a1ba44e9108f972699642a3e9d5d00d784e28fce2309d002b4ae08992deb37ffd81de33d45fc10aafaf6b72f5bb1adf699
7
- data.tar.gz: f6c54e2ebae56af1334b4a293658c13cd64b7840411fac171d157330871bc43e430bb5fd18ab93ffcd495dc273c4fc745c4c84a5997a7da979db4c279e895987
6
+ metadata.gz: 3ec17abf80a633fdb381058b750784c1ceaa8e0c085e7805c76186600d0d11752e1f7284ce672c95d291a874fa625a828116394bb030e155b80c2fe4fdc630be
7
+ data.tar.gz: 35b097021e4ee89a87c26822ad7f0f4ed4621f4e94efc31420c0d0b1ec375f58a30d28e5364d88dc48a338769662366473117e07e1be030c391bc1778a020314
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Style/Documentation:
2
+ Enabled: false
data/Guardfile ADDED
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.call("routing/#{m[1]}_routing"),
51
+ rspec.spec.call("controllers/#{m[1]}_controller"),
52
+ rspec.spec.call("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # Vindetta
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vindetta`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ [![Build Status](https://travis-ci.org/kyledecot/vindetta.svg?branch=master)](https://travis-ci.org/kyledecot/vindetta)
4
+ [![Code Climate](https://codeclimate.com/github/kyledecot/vindetta/badges/gpa.svg)](https://codeclimate.com/github/kyledecot/vindetta)
6
5
 
7
6
  ## Installation
8
7
 
@@ -22,7 +21,9 @@ Or install it yourself as:
22
21
 
23
22
  ## Usage
24
23
 
25
- TODO: Write usage instructions here
24
+ ```bash
25
+ $ vindetta generate
26
+ ```
26
27
 
27
28
  ## Development
28
29
 
data/lib/vindetta/cli.rb CHANGED
@@ -14,8 +14,15 @@ module Vindetta
14
14
  end
15
15
  end
16
16
 
17
- desc 'Generates a random vin'
18
- command :generate do |c|
17
+ desc 'Validates a VIN'
18
+ command [:validate, :v] do |c|
19
+ c.action do |_global, _options, args|
20
+ puts Vindetta::Validator.run(args.first)
21
+ end
22
+ end
23
+
24
+ desc 'Generates a random VIN'
25
+ command [:generate, :g] do |c|
19
26
  c.action do |_global, _options, _args|
20
27
  puts Vindetta::Generator.generate
21
28
  end
@@ -4,7 +4,7 @@ module Vindetta
4
4
 
5
5
  def self.run(character)
6
6
  index = MAPPING.find_index(character)
7
- raise Vindetta::InvalidCharacter.new(character) unless index
7
+ raise Vindetta::InvalidCharacter, character unless index
8
8
  index % 10
9
9
  end
10
10
  end
@@ -0,0 +1,7 @@
1
+ module Vindetta
2
+ class Validator
3
+ def self.run(vin)
4
+ Vin.new(vin).valid?
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Vindetta
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
data/lib/vindetta.rb CHANGED
@@ -1,8 +1,9 @@
1
- require 'vindetta/version'
2
- require 'vindetta/generator'
3
1
  require 'vindetta/cli'
4
2
  require 'vindetta/errors'
3
+ require 'vindetta/generator'
5
4
  require 'vindetta/transliterator'
5
+ require 'vindetta/validator'
6
+ require 'vindetta/version'
6
7
  require 'vindetta/vin'
7
8
 
8
9
  module Vindetta
data/vindetta.gemspec CHANGED
@@ -22,13 +22,15 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'gli', '~> 2.16'
26
25
  spec.add_dependency 'activemodel', '~> 5.1'
27
26
  spec.add_dependency 'activesupport', '~> 5.1'
27
+ spec.add_dependency 'gli', '~> 2.16'
28
28
 
29
29
  spec.add_development_dependency 'bundler', '~> 1.14'
30
+ spec.add_development_dependency 'factory_girl', '~> 4.8.0'
31
+ spec.add_development_dependency 'guard', '~> 2.14.1'
32
+ spec.add_development_dependency 'pry', '~> 0.10'
30
33
  spec.add_development_dependency 'rake', '~> 10.0'
31
34
  spec.add_development_dependency 'rspec', '~> 3.0'
32
- spec.add_development_dependency 'pry'
33
- spec.add_development_dependency 'rubocop'
35
+ spec.add_development_dependency 'rubocop', '~> 0.49'
34
36
  end
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vindetta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.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-08-30 00:00:00.000000000 Z
11
+ date: 2017-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: gli
14
+ name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.16'
19
+ version: '5.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.16'
26
+ version: '5.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: activemodel
28
+ name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: activesupport
42
+ name: gli
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.1'
47
+ version: '2.16'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.1'
54
+ version: '2.16'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,61 +67,89 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.14'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: factory_girl
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: 4.8.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: 4.8.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec
84
+ name: guard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.0'
89
+ version: 2.14.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.0'
96
+ version: 2.14.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.10'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.10'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '10.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: '0'
131
+ version: '3.0'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - ">="
136
+ - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '0'
138
+ version: '3.0'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: rubocop
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
- - - ">="
143
+ - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '0'
145
+ version: '0.49'
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
- - - ">="
150
+ - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: '0'
152
+ version: '0.49'
125
153
  description: Ruby gem for generating VINs
126
154
  email:
127
155
  - kyle@joinroot.com
@@ -132,8 +160,10 @@ extra_rdoc_files: []
132
160
  files:
133
161
  - ".gitignore"
134
162
  - ".rspec"
163
+ - ".rubocop.yml"
135
164
  - ".travis.yml"
136
165
  - Gemfile
166
+ - Guardfile
137
167
  - LICENSE.txt
138
168
  - README.md
139
169
  - Rakefile
@@ -145,9 +175,9 @@ files:
145
175
  - lib/vindetta/errors.rb
146
176
  - lib/vindetta/generator.rb
147
177
  - lib/vindetta/transliterator.rb
178
+ - lib/vindetta/validator.rb
148
179
  - lib/vindetta/version.rb
149
180
  - lib/vindetta/vin.rb
150
- - rubocop.yml
151
181
  - vindetta.gemspec
152
182
  homepage: https://github.com/kyledecot/vindetta
153
183
  licenses:
data/rubocop.yml DELETED
File without changes