mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
MonkeyPatch jruby's Array#pretty_inspect [Fixes #568]
This commit is contained in:
parent
f2f421bf4b
commit
6967224ccb
1 changed files with 21 additions and 0 deletions
|
@ -51,3 +51,24 @@ class Object
|
|||
__binding_impl__
|
||||
end
|
||||
end
|
||||
|
||||
# There's a splat bug on jruby in 1.9 emulation mode, which breaks the
|
||||
# pp library.
|
||||
#
|
||||
# * http://jira.codehaus.org/browse/JRUBY-6687
|
||||
# * https://github.com/pry/pry/issues/568
|
||||
#
|
||||
# Until that gets fixed upstream, let's monkey-patch here:
|
||||
if [[1, 2]].pretty_inspect == "[1]\n"
|
||||
class Array
|
||||
def pretty_print(q)
|
||||
q.group(1, '[', ']') {
|
||||
i = 0
|
||||
q.seplist(self) { |*|
|
||||
q.pp self[i]
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue