my_zipcode_gem 0.2.1 → 0.2.2.pre.alpha.pre.25

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
- SHA1:
3
- metadata.gz: fa3086991a379075e85a57c7165f3435dd2b193c
4
- data.tar.gz: 73ca08c0d39a99b4da16cde40c2772d1a6098e7e
2
+ SHA256:
3
+ metadata.gz: 5efef1df6c49bc39e4f0c03fa423a61a718e2b14bc7952af4495b77c83e7a664
4
+ data.tar.gz: 8ef8f4ad04321ca13cf2f5f67af371f2b23b67bc8245c6efee84b00831e5114a
5
5
  SHA512:
6
- metadata.gz: 744078d00f5ae40c44241ac57784dbf1602a372532a125a5af6998ebb3a5b36b07d0796f7b62cc9a30db29fc19666d3482c8badb89542fab3387af7b2d78ff82
7
- data.tar.gz: b77952605f4e0ed337ec44ee920e061b513334dd488f282ff41344e1fe6573f93cf56e05b1bad5cfd42ad07ba2634446206589c7c8270a5cdb588836d32b68f1
6
+ metadata.gz: 6cc6e0b2b8cf3e0fdda555e15638608439a56d03baa237fb5bc7e02821235941b8b4d6c15e2317fd58a4e63470353422379cfd0c1270e4419e87483e3b0cec65
7
+ data.tar.gz: 6dedaa7d0c1583396c3e0d94bbe831782f77f8643e8319ae7acd0d12e4f674a6e96b7edebd65b849ebfbe1f548a777b68ea752db58706ba69b0951605a494d7a
data/.rubocop.yml ADDED
@@ -0,0 +1,4 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Layout/DotPosition:
4
+ EnforcedStyle: leading
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,318 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2017-12-19 21:32:06 -0600 using RuboCop version 0.52.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 3
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: Include, TreatCommentsAsGroupSeparators.
12
+ # Include: **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'Gemfile'
16
+
17
+ # Offense count: 1
18
+ # Cop supports --auto-correct.
19
+ # Configuration parameters: Include, TreatCommentsAsGroupSeparators.
20
+ # Include: **/*.gemspec
21
+ Gemspec/OrderedDependencies:
22
+ Exclude:
23
+ - 'my_zipcode_gem.gemspec'
24
+
25
+ # Offense count: 1
26
+ # Cop supports --auto-correct.
27
+ Layout/EmptyLineAfterMagicComment:
28
+ Exclude:
29
+ - 'my_zipcode_gem.gemspec'
30
+
31
+ # Offense count: 2
32
+ # Cop supports --auto-correct.
33
+ # Configuration parameters: EnforcedStyle.
34
+ # SupportedStyles: empty_lines, no_empty_lines
35
+ Layout/EmptyLinesAroundBlockBody:
36
+ Exclude:
37
+ - 'lib/generators/my_zipcode_gem/templates/zipcodes.rake'
38
+
39
+ # Offense count: 1
40
+ # Cop supports --auto-correct.
41
+ # Configuration parameters: EnforcedStyle.
42
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
43
+ Layout/EmptyLinesAroundClassBody:
44
+ Exclude:
45
+ - 'lib/my_zipcode_gem.rb'
46
+
47
+ # Offense count: 4
48
+ # Cop supports --auto-correct.
49
+ # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
50
+ Layout/ExtraSpacing:
51
+ Exclude:
52
+ - 'features/support/string.rb'
53
+
54
+ # Offense count: 3
55
+ # Cop supports --auto-correct.
56
+ # Configuration parameters: IndentationWidth.
57
+ # SupportedStyles: special_inside_parentheses, consistent, align_brackets
58
+ Layout/IndentArray:
59
+ EnforcedStyle: consistent
60
+
61
+ # Offense count: 3
62
+ # Cop supports --auto-correct.
63
+ # Configuration parameters: EnforcedStyle.
64
+ # SupportedStyles: normal, rails
65
+ Layout/IndentationConsistency:
66
+ Exclude:
67
+ - 'lib/my_zipcode_gem.rb'
68
+
69
+ # Offense count: 1
70
+ # Cop supports --auto-correct.
71
+ Layout/LeadingCommentSpace:
72
+ Exclude:
73
+ - 'features/support/string.rb'
74
+
75
+ # Offense count: 5
76
+ # Cop supports --auto-correct.
77
+ Layout/SpaceAfterComma:
78
+ Exclude:
79
+ - 'features/support/string.rb'
80
+
81
+ # Offense count: 4
82
+ # Cop supports --auto-correct.
83
+ # Configuration parameters: AllowForAlignment.
84
+ Layout/SpaceAroundOperators:
85
+ Exclude:
86
+ - 'features/support/string.rb'
87
+
88
+ # Offense count: 4
89
+ # Cop supports --auto-correct.
90
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
91
+ # SupportedStyles: space, no_space
92
+ # SupportedStylesForEmptyBraces: space, no_space
93
+ Layout/SpaceBeforeBlockBraces:
94
+ Exclude:
95
+ - 'features/support/string.rb'
96
+ - 'lib/my_zipcode_gem.rb'
97
+ - 'my_zipcode_gem.gemspec'
98
+
99
+ # Offense count: 4
100
+ # Cop supports --auto-correct.
101
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
102
+ # SupportedStyles: space, no_space
103
+ # SupportedStylesForEmptyBraces: space, no_space
104
+ Layout/SpaceInsideBlockBraces:
105
+ Exclude:
106
+ - 'features/support/string.rb'
107
+
108
+ # Offense count: 17
109
+ # Cop supports --auto-correct.
110
+ Layout/TrailingWhitespace:
111
+ Exclude:
112
+ - 'features/step_definitions/common_steps.rb'
113
+ - 'features/support/string.rb'
114
+
115
+ # Offense count: 1
116
+ Lint/RescueException:
117
+ Exclude:
118
+ - 'lib/generators/my_zipcode_gem/templates/zipcodes.rake'
119
+
120
+ # Offense count: 1
121
+ Lint/UselessAssignment:
122
+ Exclude:
123
+ - 'features/support/string.rb'
124
+
125
+ # Offense count: 1
126
+ Metrics/AbcSize:
127
+ Max: 26
128
+
129
+ # Offense count: 2
130
+ # Configuration parameters: CountComments, ExcludedMethods.
131
+ Metrics/BlockLength:
132
+ Max: 148
133
+
134
+ # Offense count: 1
135
+ # Configuration parameters: CountComments.
136
+ Metrics/MethodLength:
137
+ Max: 29
138
+
139
+ # Offense count: 4
140
+ # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
141
+ # NamePrefix: is_, has_, have_
142
+ # NamePrefixBlacklist: is_, has_, have_
143
+ # NameWhitelist: is_a?
144
+ # MethodDefinitionMacros: define_method, define_singleton_method
145
+ Naming/PredicateName:
146
+ Exclude:
147
+ - 'spec/**/*'
148
+ - 'features/support/string.rb'
149
+
150
+ # Offense count: 6
151
+ Style/Documentation:
152
+ Exclude:
153
+ - 'spec/**/*'
154
+ - 'test/**/*'
155
+ - 'features/support/string.rb'
156
+ - 'lib/generators/my_zipcode_gem/models_generator.rb'
157
+ - 'lib/generators/my_zipcode_gem/templates/county_model.rb'
158
+ - 'lib/generators/my_zipcode_gem/templates/migration.rb'
159
+ - 'lib/generators/my_zipcode_gem/templates/state_model.rb'
160
+ - 'lib/generators/my_zipcode_gem/templates/zipcode_model.rb'
161
+
162
+ # Offense count: 1
163
+ # Cop supports --auto-correct.
164
+ Style/Encoding:
165
+ Exclude:
166
+ - 'my_zipcode_gem.gemspec'
167
+
168
+ # Offense count: 1
169
+ # Cop supports --auto-correct.
170
+ # Configuration parameters: EnforcedStyle.
171
+ # SupportedStyles: format, sprintf, percent
172
+ Style/FormatString:
173
+ Exclude:
174
+ - 'lib/generators/my_zipcode_gem/models_generator.rb'
175
+
176
+ # Offense count: 1
177
+ # Configuration parameters: .
178
+ # SupportedStyles: annotated, template, unannotated
179
+ Style/FormatStringToken:
180
+ EnforcedStyle: unannotated
181
+
182
+ # Offense count: 28
183
+ # Cop supports --auto-correct.
184
+ # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
185
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
186
+ Style/HashSyntax:
187
+ Exclude:
188
+ - 'Rakefile'
189
+ - 'features/step_definitions/common_steps.rb'
190
+ - 'lib/generators/my_zipcode_gem/models_generator.rb'
191
+ - 'lib/generators/my_zipcode_gem/templates/migration.rb'
192
+ - 'lib/generators/my_zipcode_gem/templates/zipcodes.rake'
193
+
194
+ # Offense count: 2
195
+ # Cop supports --auto-correct.
196
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
197
+ # SupportedStyles: predicate, comparison
198
+ Style/NumericPredicate:
199
+ Exclude:
200
+ - 'spec/**/*'
201
+ - 'features/support/string.rb'
202
+
203
+ # Offense count: 5
204
+ # Cop supports --auto-correct.
205
+ # Configuration parameters: PreferredDelimiters.
206
+ Style/PercentLiteralDelimiters:
207
+ Exclude:
208
+ - 'features/step_definitions/rails_setup_steps.rb'
209
+ - 'my_zipcode_gem.gemspec'
210
+
211
+ # Offense count: 1
212
+ # Cop supports --auto-correct.
213
+ Style/RedundantBegin:
214
+ Exclude:
215
+ - 'features/support/string.rb'
216
+
217
+ # Offense count: 2
218
+ # Cop supports --auto-correct.
219
+ Style/RedundantConditional:
220
+ Exclude:
221
+ - 'features/support/string.rb'
222
+
223
+ # Offense count: 2
224
+ # Cop supports --auto-correct.
225
+ # Configuration parameters: AllowMultipleReturnValues.
226
+ Style/RedundantReturn:
227
+ Exclude:
228
+ - 'features/support/string.rb'
229
+
230
+ # Offense count: 10
231
+ # Cop supports --auto-correct.
232
+ Style/RedundantSelf:
233
+ Exclude:
234
+ - 'features/support/string.rb'
235
+ - 'lib/my_zipcode_gem.rb'
236
+
237
+ # Offense count: 2
238
+ # Cop supports --auto-correct.
239
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
240
+ # SupportedStyles: slashes, percent_r, mixed
241
+ Style/RegexpLiteral:
242
+ Exclude:
243
+ - 'features/support/string.rb'
244
+
245
+ # Offense count: 1
246
+ # Cop supports --auto-correct.
247
+ # Configuration parameters: EnforcedStyle.
248
+ # SupportedStyles: implicit, explicit
249
+ Style/RescueStandardError:
250
+ Exclude:
251
+ - 'features/support/string.rb'
252
+
253
+ # Offense count: 2
254
+ # Cop supports --auto-correct.
255
+ # Configuration parameters: AllowAsExpressionSeparator.
256
+ Style/Semicolon:
257
+ Exclude:
258
+ - 'features/support/string.rb'
259
+
260
+ # Offense count: 1
261
+ # Cop supports --auto-correct.
262
+ # Configuration parameters: .
263
+ # SupportedStyles: use_perl_names, use_english_names
264
+ Style/SpecialGlobalVars:
265
+ EnforcedStyle: use_perl_names
266
+
267
+ # Offense count: 79
268
+ # Cop supports --auto-correct.
269
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
270
+ # SupportedStyles: single_quotes, double_quotes
271
+ Style/StringLiterals:
272
+ Exclude:
273
+ - 'Rakefile'
274
+ - 'features/step_definitions/common_steps.rb'
275
+ - 'features/step_definitions/rails_setup_steps.rb'
276
+ - 'features/support/env.rb'
277
+ - 'features/support/string.rb'
278
+ - 'lib/generators/my_zipcode_gem/models_generator.rb'
279
+ - 'lib/generators/my_zipcode_gem/templates/county_model.rb'
280
+ - 'lib/generators/my_zipcode_gem/templates/zipcode_model.rb'
281
+ - 'lib/generators/my_zipcode_gem/templates/zipcodes.rake'
282
+ - 'lib/my_zipcode_gem.rb'
283
+ - 'my_zipcode_gem.gemspec'
284
+
285
+ # Offense count: 1
286
+ # Cop supports --auto-correct.
287
+ # Configuration parameters: MinSize.
288
+ # SupportedStyles: percent, brackets
289
+ Style/SymbolArray:
290
+ EnforcedStyle: brackets
291
+
292
+ # Offense count: 2
293
+ # Cop supports --auto-correct.
294
+ # Configuration parameters: IgnoredMethods.
295
+ # IgnoredMethods: respond_to, define_method
296
+ Style/SymbolProc:
297
+ Exclude:
298
+ - 'features/support/string.rb'
299
+ - 'lib/my_zipcode_gem.rb'
300
+
301
+ # Offense count: 2
302
+ # Cop supports --auto-correct.
303
+ Style/UnneededPercentQ:
304
+ Exclude:
305
+ - 'my_zipcode_gem.gemspec'
306
+
307
+ # Offense count: 3
308
+ # Cop supports --auto-correct.
309
+ # Configuration parameters: MinSize, WordRegex.
310
+ # SupportedStyles: percent, brackets
311
+ Style/WordArray:
312
+ EnforcedStyle: brackets
313
+
314
+ # Offense count: 40
315
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
316
+ # URISchemes: http, https
317
+ Metrics/LineLength:
318
+ Max: 141
data/.travis.yml CHANGED
@@ -1,19 +1,28 @@
1
1
  language: ruby
2
- bundler_args: --without development
2
+
3
3
  rvm:
4
4
  - 1.9.3
5
- - 2.0
6
- - 2.1
7
-
5
+ - 2.3
6
+ - 2.4
7
+
8
8
  before_script:
9
9
  # - psql -c 'create database my_zipcode_gem_test;' -U postgres
10
10
  # - mysql -e 'create database my_zipcode_gem_test;'
11
-
12
- gemfile:
13
- - rails3_2.gemfile
14
- - rails4_0.gemfile
15
- - rails4_1.gemfile
16
-
17
- branches:
18
- only:
19
- - master
11
+
12
+ script:
13
+ - bundle exec rake build
14
+
15
+ #gemfile:
16
+ # - rails3_2.gemfile
17
+ # - rails4_0.gemfile
18
+ # - rails4_1.gemfile
19
+
20
+ notifications:
21
+ email: false
22
+
23
+ deploy:
24
+ provider: rubygems
25
+ api_key: $RUBYGEMS_KEY
26
+ on:
27
+ all_branches: true
28
+ ruby: 2.3
data/Gemfile CHANGED
@@ -2,12 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- # jquery-rails is used by the dummy application
6
- gem 'jquery-rails'
7
- gem 'sqlite3'
8
- gem 'mysql2'
9
- gem 'pg'
10
-
11
5
  group :development do
12
6
  gem 'midwire_common'
13
7
  end
@@ -19,6 +13,7 @@ group :test do
19
13
  gem 'shoulda', '~> 3.5'
20
14
  gem 'rspec', '~> 2.12'
21
15
  gem 'rspec-rails', '~> 2.12'
16
+ gem 'rubocop'
22
17
  gem 'cucumber'
23
18
  gem 'cucumber-rails', '~> 1.3.0', require: false
24
19
  end
@@ -13,7 +13,7 @@ Feature: My Zipcode Gem
13
13
  | app/models/county.rb |
14
14
  | lib/tasks/zipcodes.rake |
15
15
  | db/migrate |
16
- And I should see "gem "mocha"" in file "Gemfile"
16
+ And I should see "gem 'mocha'" in file "Gemfile"
17
17
  And I should successfully run "rake db:migrate"
18
18
 
19
19
  Scenario: Update data for zipcodes, counties and states tables
@@ -13,8 +13,15 @@ class Zipcode < ActiveRecord::Base
13
13
  def find_by_city_state(city, state)
14
14
  includes(county: :state)
15
15
  .where("city like ? AND states.abbr like ?", "#{city}%", "%#{state}%")
16
+ .references(:state)
16
17
  .first
17
18
  end
19
+
20
+ def find_all_by_city_state(city, state)
21
+ includes(county: :state)
22
+ .where("city like ? AND states.abbr like ?", "#{city}%", "%#{state}%")
23
+ .references(:state)
24
+ end
18
25
  end
19
26
 
20
27
  def latlon
@@ -1,3 +1,3 @@
1
1
  module MyZipcodeGem
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -2,9 +2,36 @@
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
  require "generators/my_zipcode_gem/version"
4
4
 
5
+ class TravisHelper
6
+ def self.travis?
7
+ !!ENV['TRAVIS']
8
+ end
9
+
10
+ def self.master_branch?
11
+ ENV['TRAVIS_BRANCH'] == 'master'
12
+ end
13
+
14
+ def self.tag?
15
+ !!ENV['TRAVIS_TAG'] && ENV['TRAVIS_TAG'] != ''
16
+ end
17
+
18
+ def self.pull_request?
19
+ ENV['TRAVIS_PULL_REQUEST'] != 'false'
20
+ end
21
+ end
22
+
5
23
  Gem::Specification.new do |s|
6
24
  s.name = "my_zipcode_gem"
7
25
  s.version = MyZipcodeGem::VERSION
26
+
27
+ puts "travis? #{TravisHelper.travis?}"
28
+ puts "master_branch? #{TravisHelper.master_branch?}"
29
+ puts "tag? #{TravisHelper.tag?}"
30
+ puts "tag #{ENV['TRAVIS_TAG'].inspect}"
31
+ if TravisHelper.travis? && !(TravisHelper.master_branch? || TravisHelper.tag? || TravisHelper.pull_request?)
32
+ s.version = "#{s.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}"
33
+ end
34
+
8
35
  s.platform = Gem::Platform::RUBY
9
36
  s.authors = ["Chris Blackburn", "Chris McKnight"]
10
37
  s.email = ["chris [at] midwiretech [dot] com", "cmckni3 [at] gmail [dot] com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_zipcode_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2.pre.alpha.pre.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Blackburn
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-13 00:00:00.000000000 Z
12
+ date: 2017-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -48,6 +48,8 @@ extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
+ - ".rubocop.yml"
52
+ - ".rubocop_todo.yml"
51
53
  - ".travis.yml"
52
54
  - Gemfile
53
55
  - MIT-LICENSE
@@ -85,18 +87,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
87
  version: '0'
86
88
  required_rubygems_version: !ruby/object:Gem::Requirement
87
89
  requirements:
88
- - - ">="
90
+ - - ">"
89
91
  - !ruby/object:Gem::Version
90
- version: '0'
92
+ version: 1.3.1
91
93
  requirements: []
92
94
  rubyforge_project: my_zipcode_gem
93
- rubygems_version: 2.5.1
95
+ rubygems_version: 2.7.3
94
96
  signing_key:
95
97
  specification_version: 4
96
98
  summary: A Ruby gem to handle all things zipcode.
97
- test_files:
98
- - features/step_definitions/common_steps.rb
99
- - features/step_definitions/rails_setup_steps.rb
100
- - features/support/env.rb
101
- - features/support/string.rb
102
- - features/zipcodes.feature
99
+ test_files: []