Skip to content

Commit

Permalink
Fix Ruby keyword warning in check:memory Rake task (#1431)
Browse files Browse the repository at this point in the history
As of Ruby 2.7, warnings are generated when the `check:memory` Rake task
is run due to the use of a Hash object as an argument. This commit omits
the use of the Hash object.
  • Loading branch information
ashmaroli committed Apr 3, 2020
1 parent b942deb commit 5213a03
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tasks/check/memory.rake
Expand Up @@ -15,18 +15,17 @@ namespace :check do
formatter.format ruby_lexer.lex(sample)
formatter.format guessed_lexer.lex(sample)
end
print_options = { scale_bytes: true, normalize_paths: true }

if ENV['CI']
report.pretty_print(print_options)
report.pretty_print(scale_bytes: true, normalize_paths: true)
else
results_file = File.expand_path('rouge-memory.tmp', dir)
t_allocated = report.scale_bytes(report.total_allocated_memsize)
t_retained = report.scale_bytes(report.total_retained_memsize)
puts
puts "Total allocated: #{t_allocated} (#{report.total_allocated} objects)"
puts "Total retained: #{t_retained} (#{report.total_retained} objects)"
report.pretty_print(print_options.merge(to_file: results_file))
report.pretty_print(to_file: results_file, scale_bytes: true, normalize_paths: true)
puts
puts "Detailed report saved to file: #{results_file}"
end
Expand Down

0 comments on commit 5213a03

Please sign in to comment.