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 #1

Updated by nobu (Nobuyoshi Nakada) about 2 months ago

  • Tracker changed from Feature to Bug
  • Backport set to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED
Actions #2

Updated by nobu (Nobuyoshi Nakada) about 2 months ago

  • Status changed from Open to Closed

Applied in changeset git|c6dbb10b7408cab17f170f0b23d1bbf0db03ad55.


[Bug #20982] Put spaces in ENV.inspect results as well as Hash

Updated by k0kubun (Takashi Kokubun) 9 days ago

Cherry-picking c6dbb10b7408cab17f170f0b23d1bbf0db03ad55 to ruby_3_4 caused a conflict. Could you file a PR that resolves it?

Updated by k0kubun (Takashi Kokubun) 8 days ago

  • Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE

Updated by k0kubun (Takashi Kokubun) 8 days ago

Thanks for the PR.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0