1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/prettyprint.rb (PrettyPrint#seplist): added.

* lib/pp.rb (PPMethods#pp_object): use seplist.
  (PPMethods#pp_hash): ditto.
  (Array#pretty_print): ditto.
  (Struct#pretty_print): ditto.
  (MatchData#pretty_print): ditto.

* lib/set.rb (Set#pretty_print): use seplist.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2004-02-05 14:59:46 +00:00
parent c3c6d7cbca
commit 9f45dc126c
4 changed files with 32 additions and 19 deletions

View file

@ -418,14 +418,7 @@ class Set
def pretty_print(pp) # :nodoc:
pp.text sprintf('#<%s: {', self.class.name)
pp.nest(1) {
first = true
each { |o|
if first
first = false
else
pp.text ","
pp.breakable
end
pp.seplist(self) { |o|
pp.pp o
}
}