Skip to content

Commit

Permalink
Fix build, due to Rubocop error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
64kramsystem committed Feb 17, 2021
1 parent 677baf2 commit 88219b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/roundtrip/test_rubyc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88219b1

Please sign in to comment.