Skip to content

Commit

Permalink
Update for new Rubocop 1.64.0 cops
Browse files Browse the repository at this point in the history
  • Loading branch information
timriley committed May 25, 2024
1 parent a44a01e commit 9bc7c7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/hanami/utils/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module Kernel # rubocop:disable Metrics/ModuleLength
# response = Response.new(200, {}, 'hello')
# Hanami::Utils::Kernel.Array(response) # => [200, {}, "hello"]
def self.Array(arg)
super(arg).dup.tap do |a|
super.dup.tap do |a|
a.flatten!
a.compact!
a.uniq!
Expand Down Expand Up @@ -215,7 +215,7 @@ def self.Hash(arg)
if arg.respond_to?(:to_h)
arg.to_h
else
super(arg)
super
end
rescue NoMethodError
raise TypeError.new "can't convert #{inspect_type_error(arg)}into Hash"
Expand Down Expand Up @@ -329,7 +329,7 @@ def self.Hash(arg)
# input = Complex(2, 3)
# Hanami::Utils::Kernel.Integer(input) # => TypeError
def self.Integer(arg)
super(arg)
super
rescue ArgumentError, TypeError, NoMethodError
begin
case arg
Expand Down Expand Up @@ -549,7 +549,7 @@ def self.BigDecimal(arg, precision = ::Float::DIG)
# input = Complex(2, 3)
# Hanami::Utils::Kernel.Float(input) # => TypeError
def self.Float(arg)
super(arg)
super
rescue ArgumentError, TypeError
begin
case arg
Expand Down Expand Up @@ -654,7 +654,7 @@ def self.Float(arg)
# Hanami::Utils::Kernel.String(input) # => TypeError
def self.String(arg)
arg = arg.to_str if arg.respond_to?(:to_str)
super(arg)
super
rescue NoMethodError
raise TypeError.new "can't convert #{inspect_type_error(arg)}into String"
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/hanami/utils/string_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

it "applies transformations from proc" do
input = "Hanami"
actual = Hanami::Utils::String.transform(input, ->(i) { i.upcase })
actual = Hanami::Utils::String.transform(input, ->(i) { i.upcase }) # rubocop:disable Style/SymbolProc

expect(input).to eq("Hanami")
expect(actual).to eq("HANAMI")
Expand Down

0 comments on commit 9bc7c7c

Please sign in to comment.