Skip to content

Commit e62d6f4

Browse files
committed
Drop ColorPrinter's workaround for BasicObject
`pp` 0.6.0+ includes ruby/pp#26 to handle BasicObject, so we can drop the workaround.
1 parent 49050f9 commit e62d6f4

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

irb.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
4343

4444
spec.add_dependency "reline", ">= 0.4.2"
4545
spec.add_dependency "rdoc", ">= 4.0.0"
46+
spec.add_dependency "pp", ">= 0.6.0"
4647
end

lib/irb/color_printer.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
module IRB
66
class ColorPrinter < ::PP
7-
METHOD_RESPOND_TO = Object.instance_method(:respond_to?)
8-
METHOD_INSPECT = Object.instance_method(:inspect)
9-
107
class << self
118
def pp(obj, out = $>, width = screen_width)
129
q = ColorPrinter.new(out, width)
@@ -28,8 +25,6 @@ def pp(obj)
2825
if String === obj
2926
# Avoid calling Ruby 2.4+ String#pretty_print that splits a string by "\n"
3027
text(obj.inspect)
31-
elsif !METHOD_RESPOND_TO.bind(obj).call(:inspect)
32-
text(METHOD_INSPECT.bind(obj).call)
3328
else
3429
super
3530
end

0 commit comments

Comments
 (0)