File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 42
42
with :
43
43
ruby-version : ${{ matrix.ruby }}
44
44
bundler-cache : true
45
+ # Added to make Ruby 2.7 correctly require installed default gems, like `pp`.
46
+ rubygems : latest
45
47
- name : Run tests
46
48
run : bundle exec rake test
47
49
- name : Run tests in isolation
Original file line number Diff line number Diff line change @@ -42,4 +42,5 @@ Gem::Specification.new do |spec|
42
42
43
43
spec . add_dependency "reline" , ">= 0.4.2"
44
44
spec . add_dependency "rdoc" , ">= 4.0.0"
45
+ spec . add_dependency "pp" , ">= 0.6.0"
45
46
end
Original file line number Diff line number Diff line change 4
4
5
5
module IRB
6
6
class ColorPrinter < ::PP
7
- METHOD_RESPOND_TO = Object . instance_method ( :respond_to? )
8
- METHOD_INSPECT = Object . instance_method ( :inspect )
9
-
10
7
class << self
11
8
def pp ( obj , out = $>, width = screen_width )
12
9
q = ColorPrinter . new ( out , width )
@@ -28,8 +25,6 @@ def pp(obj)
28
25
if String === obj
29
26
# Avoid calling Ruby 2.4+ String#pretty_print that splits a string by "\n"
30
27
text ( obj . inspect )
31
- elsif !METHOD_RESPOND_TO . bind ( obj ) . call ( :inspect )
32
- text ( METHOD_INSPECT . bind ( obj ) . call )
33
28
else
34
29
super
35
30
end
You can’t perform that action at this time.
0 commit comments