summaryrefslogtreecommitdiff
path: root/lib/pp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pp.rb')
-rw-r--r--lib/pp.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index 0d16be55d8..352c26f636 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -488,11 +488,12 @@ end if defined?(Data.define)
class Range # :nodoc:
def pretty_print(q) # :nodoc:
- q.pp self.begin if self.begin
+ both_nil = self.begin == nil && self.end == nil
+ q.pp self.begin if self.begin != nil || both_nil
q.breakable ''
q.text(self.exclude_end? ? '...' : '..')
q.breakable ''
- q.pp self.end if self.end
+ q.pp self.end if self.end != nil || both_nil
end
end