From 23499e2e82add5d59aa7bee417d8437699428f7e Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 5 Feb 2004 14:59:46 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/set.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/set.rb') diff --git a/lib/set.rb b/lib/set.rb index a19a4f3b5..e9c6931b1 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -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 } } -- cgit