1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

add workaround for Coderay object literals

This commit is contained in:
Ryan Fitzgerald 2011-10-18 23:24:37 -07:00
parent 2d72344673
commit c544c1d699

View file

@ -32,7 +32,11 @@ class Pry
stringified = "#<#{klass}:0x#{value.__id__.to_s(16)}>"
end
Helpers::BaseHelpers.stagger_output("=> #{Helpers::BaseHelpers.colorize_code(stringified)}", output)
nonce = rand(0x100000000).to_s(16) # whatever
colorized = Helpers::BaseHelpers.colorize_code(stringified.gsub(/#</, "%<#{nonce}"))
Helpers::BaseHelpers.stagger_output("=> #{colorized.gsub(/%<(.*?)#{nonce}/, '#<\1')}", output)
end
# may be convenient when working with enormous objects and