summaryrefslogtreecommitdiff
path: root/lib/pp.rb
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2023-11-30 17:10:40 +0100
committergit <[email protected]>2024-01-11 13:44:01 +0000
commit1ed3b6037566cef3d56e882eb0fcf1b14553f540 ()
tree0aff22917c79cb6dd5e475dcb59050fd4a257953 /lib/pp.rb
parent62382a434561b6fe56d479b8800cf6ccf017463c (diff)
[ruby/pp] Fix pretty printing a Data subclass instance when the subclass is anonymous
* It would be "#<data a=42>" (double space) instead of "#<data a=42>" (like #inspect). https://.com/ruby/pp/commit/bed72bfcb8
-rw-r--r--lib/pp.rb4
1 files changed, 3 insertions, 1 deletions
@@ -422,7 +422,9 @@ end
class Data # :nodoc:
def pretty_print(q) # :nodoc:
- q.group(1, sprintf("#<data %s", PP.mcall(self, Kernel, :class).name), '>') {
q.seplist(PP.mcall(self, Kernel, :class).members, lambda { q.text "," }) {|member|
q.breakable
q.text member.to_s