Skip to content

Commit

Permalink
🤖 makes rubocop 0.55 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilperez committed Apr 22, 2018
1 parent 4d5ba59 commit f310bd2
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 69 deletions.
30 changes: 13 additions & 17 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ AllCops:
# Include common Ruby source files.
Include:
- '**/*.gemspec'
- '**/*.gemfile'
- '**/*.podspec'
- '**/*.jbuilder'
- '**/*.rake'
Expand Down Expand Up @@ -386,16 +387,6 @@ Layout/EmptyLinesAroundModuleBody:
- empty_lines
- no_empty_lines

# Checks whether the source file has a utf-8 encoding comment or not
# AutoCorrectEncodingComment must match the regex
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
Style/Encoding:
EnforcedStyle: when_needed
SupportedStyles:
- when_needed
- always
AutoCorrectEncodingComment: '# encoding: utf-8'

Style/FileName:
# File names listed in AllCops:Include are excluded by default. Add extra
# excludes here.
Expand Down Expand Up @@ -475,9 +466,6 @@ Style/HashSyntax:
# Force hashes that have a symbol value to use hash rockets
UseHashRocketsWithSymbolValues: false

Style/IfUnlessModifier:
MaxLineLength: 80

Layout/IndentationConsistency:
# The difference between `rails` and `normal` is that the `rails` style
# prescribes that in classes and modules the `protected` and `private`
Expand Down Expand Up @@ -712,7 +700,18 @@ Layout/TrailingBlankLines:
- final_newline
- final_blank_line

Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
# If EnforcedStyleForMultiline is comma, the cop requires a comma after the
# last item of a list, but only for lists where each item is on its own line.
# If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
# after the last item of a list, for all lists.
EnforcedStyleForMultiline: no_comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma

Style/TrailingCommaInHashLiteral:
# If EnforcedStyleForMultiline is comma, the cop requires a comma after the
# last item of a list, but only for lists where each item is on its own line.
# If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
Expand Down Expand Up @@ -782,9 +781,6 @@ Style/VariableName:
- snake_case
- camelCase

Style/WhileUntilModifier:
MaxLineLength: 80

Style/WordArray:
MinSize: 0
# The regular expression WordRegex decides what is considered a word.
Expand Down
20 changes: 11 additions & 9 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
appraise "rails-3.2" do
# frozen_string_literal: true

appraise 'rails-3.2' do
gem 'activemodel', '~> 3.2.0'
end

appraise "rails-4.2" do
gem "activemodel", '~> 4.2.0'
appraise 'rails-4.2' do
gem 'activemodel', '~> 4.2.0'
end

appraise "rails-5.0" do
gem "activemodel", '~> 5.0.0'
appraise 'rails-5.0' do
gem 'activemodel', '~> 5.0.0'
end

appraise "rails-5.1" do
gem "activemodel", '~> 5.1.0'
appraise 'rails-5.1' do
gem 'activemodel', '~> 5.1.0'
end

appraise "rails-5.2" do
gem "activemodel", '~> 5.2.0'
appraise 'rails-5.2' do
gem 'activemodel', '~> 5.2.0'
end
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in validates_zipcode.gemspec
Expand Down
8 changes: 5 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
require "bundler/gem_tasks"
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)
task default: :spec

desc "Open an irb session preloaded with this library"
desc 'Open an irb session preloaded with this library'
task :console do
sh "irb -Ilib -rvalidates_zipcode"
sh 'irb -Ilib -rvalidates_zipcode'
end
9 changes: 6 additions & 3 deletions gemfiles/rails_3.2.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 3.2.0"
gem 'activemodel', '~> 3.2.0'
gem 'rake', '12.2.1'

gemspec :path => "../"
gemspec path: '../'
9 changes: 6 additions & 3 deletions gemfiles/rails_4.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 4.0.0"
gem 'activemodel', '~> 4.0.0'
gem 'rake', '12.2.1'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_4.1.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 4.1.0"
gem 'activemodel', '~> 4.1.0'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_4.2.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 4.2.0"
gem 'activemodel', '~> 4.2.0'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_5.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 5.0.0"
gem 'activemodel', '~> 5.0.0'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_5.1.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 5.1.0"
gem 'activemodel', '~> 5.1.0'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_5.2.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", "~> 5.2.0"
gem 'activemodel', '~> 5.2.0'

gemspec :path => "../"
gemspec path: '../'
8 changes: 5 additions & 3 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "activemodel", :github => "rails/rails"
gem 'activemodel', github: 'rails/rails'

gemspec :path => "../"
gemspec path: '../'
4 changes: 2 additions & 2 deletions spec/validates_zipcode_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
context 'Ireland' do
it 'does not add errors with a valid postcode - old format' do
['D02 AF30', 'X91 PK81', 'V94 H2PP', 'D07 R6YE', 'D6W1234',
'A230984', 'D00AV92', 'Y631FHK', 'A000000', 'D44N4X4'].each do |zipcode|
'A230984', 'D00AV92', 'Y631FHK', 'A000000', 'D44N4X4'].each do |zipcode|
record = build_record(zipcode, 'IE')
zipcode_should_be_valid(record)
end
Expand Down Expand Up @@ -263,7 +263,7 @@
end
end

['UK', 'GB'].each do |cc|
%w[UK GB].each do |cc|
context cc do
it 'validates with a valid zipcode' do
[
Expand Down
29 changes: 15 additions & 14 deletions validates_zipcode.gemspec
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'validates_zipcode/version'

Gem::Specification.new do |s|
s.name = "validates_zipcode"
s.name = 'validates_zipcode'
s.version = ValidatesZipcode::VERSION
s.authors = ["David Gil"]
s.email = ["[email protected]"]
s.summary = %q{Localizable zipcode validation for Rails.}
s.description = %q{Adds zipcode validation methods to ActiveModel considering different country zipcode formats.}
s.homepage = "http://github.com/dgilperez/validates_zipcode"
s.license = "MIT"
s.authors = ['David Gil']
s.email = ['[email protected]']
s.summary = 'Localizable zipcode validation for Rails.'
s.description = 'Adds zipcode validation methods to ActiveModel considering different country zipcode formats.'
s.homepage = 'http://github.com/dgilperez/validates_zipcode'
s.license = 'MIT'

s.files = `git ls-files -z`.split("\x0")
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ["lib"]
s.require_paths = ['lib']

s.required_ruby_version = '>= 1.9.3'

s.add_dependency 'activemodel', '>= 3.2.0'

s.add_development_dependency "bundler", "~> 1.6"
s.add_development_dependency "rake"
s.add_development_dependency "rspec"
s.add_development_dependency "appraisal"
s.add_development_dependency 'appraisal'
s.add_development_dependency 'bundler', '~> 1.6'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
end

0 comments on commit f310bd2

Please sign in to comment.