From 88219b134b8f9fa05ebc9888b86071223f9b2c14 Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Wed, 17 Feb 2021 12:20:01 +0100 Subject: [PATCH] Fix build, due to Rubocop error Fixes the error: ``` Offenses: test/roundtrip/test_rubyc.rb:33:31: C: [Correctable] Style/HashConversion: Prefer literal hash to Hash[key: value, ...]. parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test/roundtrip/test_rubyc.rb:40:31: C: [Correctable] Style/HashConversion: Prefer literal hash to Hash[key: value, ...]. parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 files inspected, 2 offenses detected, 2 offenses auto-correctable Error: Process completed with exit code 1. ``` which breaks the build. --- test/roundtrip/test_rubyc.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/roundtrip/test_rubyc.rb b/test/roundtrip/test_rubyc.rb index d25e2a2ff..95b514831 100644 --- a/test/roundtrip/test_rubyc.rb +++ b/test/roundtrip/test_rubyc.rb @@ -30,14 +30,14 @@ def ruby(*args) Thread.new do until (raw_line = stdout.gets).nil? - parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] + parsed_line = { timestamp: Time.now, line: raw_line.to_s } $stdout.puts "rubyc's ruby STDOUT: #{parsed_line}" end end Thread.new do until (raw_line = stderr.gets).nil? - parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] + parsed_line = { timestamp: Time.now, line: raw_line.to_s } warn "rubyc's ruby STDERR: #{parsed_line}" end end