Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually fix some safe offenses #43

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/hawk/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/hawk/model/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/hawk/rake/default_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

##
Expand Down
3 changes: 2 additions & 1 deletion lib/hawk/rake/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading