diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6261761..15280c8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -64,12 +64,6 @@ Metrics/ModuleLength: Metrics/PerceivedComplexity: Max: 14 -# Configuration parameters: ForbiddenDelimiters. -# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) -Naming/HeredocDelimiterNaming: - Exclude: - - 'lib/hawk/rake/default_task.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional @@ -97,10 +91,6 @@ Naming/PredicateName: Exclude: - 'lib/hawk/model/association.rb' -Performance/MethodObjectAsBlock: - Exclude: - - 'lib/hawk/http.rb' - # Configuration parameters: IgnoredMetadata. RSpec/DescribeClass: Exclude: @@ -238,12 +228,6 @@ Style/OptionalBooleanParameter: Exclude: - 'lib/hawk/model/proxy.rb' -# This cop supports safe autocorrection (--autocorrect). -Style/ParallelAssignment: - Exclude: - - 'lib/hawk/model/schema.rb' - - 'lib/hawk/rake/utils.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). Style/RedundantSelfAssignment: Exclude: diff --git a/lib/hawk/http.rb b/lib/hawk/http.rb index 173e798..32ada61 100644 --- a/lib/hawk/http.rb +++ b/lib/hawk/http.rb @@ -102,7 +102,7 @@ def request(method, path, options) instrument :request, descriptor do |descriptor| caching descriptor.update(cache_opts) do request = Typhoeus::Request.new(url, typhoeus_defaults.merge(options_for_typhoeus(request))) - request.on_complete(&method(:response_handler)) + request.on_complete { |response| response_handler(response) } request.run.body end diff --git a/lib/hawk/model/schema.rb b/lib/hawk/model/schema.rb index 9ad2be3..0503130 100644 --- a/lib/hawk/model/schema.rb +++ b/lib/hawk/model/schema.rb @@ -142,7 +142,8 @@ def after_schema(&block) class Caster def initialize(type, code) - @type, @code = type, code + @type = type + @code = code end attr_reader :type diff --git a/lib/hawk/rake/default_task.rb b/lib/hawk/rake/default_task.rb index 8be5142..d530f78 100644 --- a/lib/hawk/rake/default_task.rb +++ b/lib/hawk/rake/default_task.rb @@ -143,13 +143,13 @@ def with_appraisal(msg) # @return [String] # def fancy(msg) - <<~EOF + <<~MSG \033[0m \033[1;32m>>> \033[1;32m>>> HAWK: \033[1;37m#{msg} \033[1;32m>>> \033[0m - EOF + MSG end ## diff --git a/lib/hawk/rake/utils.rb b/lib/hawk/rake/utils.rb index 4ff0f44..a271654 100644 --- a/lib/hawk/rake/utils.rb +++ b/lib/hawk/rake/utils.rb @@ -12,7 +12,8 @@ module Utils # @return [String] the captured output # def capture_stdout - stdout, string = $stdout, StringIO.new + stdout = $stdout + string = StringIO.new $stdout = string yield