Skip to content

Commit

Permalink
Merge pull request #7 from gocardless/dependabot/bundler/rubocop-tw-0…
Browse files Browse the repository at this point in the history
….49.1

Update requirements to permit rubocop 0.49.1
  • Loading branch information
nickcampbell18 authored Aug 18, 2017
2 parents eaf3ddd + 2990a06 commit d111425
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ Style/Documentation:
Style/SignalException:
EnforcedStyle: 'only_raise'

Style/DotPosition:
Layout/DotPosition:
EnforcedStyle: 'trailing'

Metrics/BlockLength:
Exclude:
- "spec/**/*_spec.rb"
12 changes: 4 additions & 8 deletions lib/prius/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def load_int(name, required)
value = load_string(name, required)
return value if value.nil?

unless /\A[0-9]+\z/.match(value)
unless value =~ /\A[0-9]+\z/
raise TypeMismatchError, "'#{name}' value '#{value}' is not an integer"
end
value.to_i
Expand All @@ -53,13 +53,9 @@ def load_int(name, required)
def load_bool(name, required)
value = load_string(name, required)
return nil if value.nil?

if /\A(yes|y|true|t|1)\z/i.match(value)
return true
elsif /\A(no|n|false|f|0)\z/i.match(value)
return false
end
raise TypeMismatchError, "'#{name}' value '#{value}' is not an boolean"
return true if %w[yes y true t 1].include?(value)
return false if %w[no n false f 0].include?(value)
raise TypeMismatchError, "'#{name}' value '#{value}' is not a boolean"
end
end
end
2 changes: 1 addition & 1 deletion prius.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "rubocop", "~> 0.31.0"
spec.add_development_dependency "rubocop", "~> 0.49.1"
end
2 changes: 1 addition & 1 deletion spec/prius/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

it "stores an int" do
registry.load(:age, type: :int)
expect(registry.get(:age)).to be_a(Fixnum)
expect(registry.get(:age)).to be_a(Integer)
end
end

Expand Down

0 comments on commit d111425

Please sign in to comment.