mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/set] Make Set#pretty_print IRB::ColorPrinter friendly
https://github.com/ruby/set/commit/f467028cdb
This commit is contained in:
parent
a6459081bc
commit
f360ebb306
1 changed files with 6 additions and 5 deletions
11
lib/set.rb
11
lib/set.rb
|
@ -834,13 +834,14 @@ class Set
|
|||
alias to_s inspect
|
||||
|
||||
def pretty_print(pp) # :nodoc:
|
||||
pp.text sprintf('#<%s: {', self.class.name)
|
||||
pp.nest(1) {
|
||||
pp.seplist(self) { |o|
|
||||
pp.pp o
|
||||
pp.group(1, sprintf('#<%s:', self.class.name), '>') {
|
||||
pp.breakable
|
||||
pp.group(1, '{', '}') {
|
||||
pp.seplist(self) { |o|
|
||||
pp.pp o
|
||||
}
|
||||
}
|
||||
}
|
||||
pp.text "}>"
|
||||
end
|
||||
|
||||
def pretty_print_cycle(pp) # :nodoc:
|
||||
|
|
Loading…
Reference in a new issue