😊
[Bug #20982] ENV.inspect の => の前後のスペースがないバグ報告
[Bug #20982] Inconsistency between Hash#inspect and ENV.inspect in Ruby 3.4
- Ruby 3.4 からは次のように
Hash#inspect
の結果の=>
の前後にスペースが追加されるようになりました
puts({ "a" => "b" }.inspect)
# => {"a" => "b"}
- これが
ENV.inspect
だと反映されていないというバグ報告です
puts ENV.inspect
# => {"SHELL"=>"/bin/bash", ...}
-
ENV.inspect
は独自で実装されているので反映されてなかったぽいんですかね? - 開発版の Ruby 3.5-dev ではすでに対応済みです
puts ENV.inspect
# Ruby 3.4 => {"SHELL"=>"/bin/bash", ...}
# Ruby 3.5 => {"SHELL" => "/bin/bash", ...}
Discussion