From 5213a03a23c96b9e065e7876941a07d8802c2a5a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sat, 4 Apr 2020 02:07:28 +0530 Subject: [PATCH] Fix Ruby keyword warning in check:memory Rake task (#1431) 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. --- tasks/check/memory.rake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/check/memory.rake b/tasks/check/memory.rake index e2769dc7f4..2ee8e47229 100644 --- a/tasks/check/memory.rake +++ b/tasks/check/memory.rake @@ -15,10 +15,9 @@ 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) @@ -26,7 +25,7 @@ namespace :check do 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