Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/pp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ def pretty_print_cycle(q) # :nodoc:
end
end

if defined?(Set)
if set_pp = Set.instance_method(:initialize).source_location
set_pp = !set_pp.first.end_with?("/set.rb") # not defined in set.rb
else
set_pp = true # defined in C
end
end
class Set # :nodoc:
def pretty_print(pp) # :nodoc:
pp.group(1, '#<Set:', '>') {
Expand All @@ -453,12 +460,12 @@ def pretty_print(pp) # :nodoc:
}
}
}
end unless method_defined?(:pretty_print)
end

def pretty_print_cycle(pp) # :nodoc:
pp.text sprintf('#<Set: {%s}>', empty? ? '' : '...')
end unless method_defined?(:pretty_print_cycle)
end
end
end if set_pp

class << ENV # :nodoc:
def pretty_print(q) # :nodoc:
Expand Down