Project

General

Profile

Actions

Bug #20982

closed

Inconsistency between Hash#inspect and ENV.inspect in Ruby 3.4

Added by herwin (Herwin W) about 2 months ago. Updated 8 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:120409]

Description

Ruby 3.4 changed the stringified output of Hash to add whitespace to the hashrockets

ruby -e 'p({"a"=>"b"})'
{"a" => "b"}

The output of ENV.inspect is very similar to Hash#inspect, but does not include the whitespace

ruby -e 'p ENV'
{"SHELL"=>"/bin/bash", [...] }

Adding the extra whitespace around the hashrockets would improve the readability, and make things more consistent.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0