* lib/pp.rb (Kernel.pp): module function.
(MatchData#pretty_print): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1cf8e92801
commit
03e45b46ea
@ -1,3 +1,8 @@
|
|||||||
|
Fri Mar 7 21:57:25 2003 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* lib/pp.rb (Kernel.pp): module function.
|
||||||
|
(MatchData#pretty_print): new method.
|
||||||
|
|
||||||
Fri Mar 7 20:27:19 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Fri Mar 7 20:27:19 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* ext/tcltklib/extconf.rb (find_tcl, find_tk): return true if
|
* ext/tcltklib/extconf.rb (find_tcl, find_tk): return true if
|
||||||
|
13
lib/pp.rb
13
lib/pp.rb
@ -127,6 +127,7 @@ module Kernel
|
|||||||
}
|
}
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
module_function :pp
|
||||||
end
|
end
|
||||||
|
|
||||||
class PP < PrettyPrint
|
class PP < PrettyPrint
|
||||||
@ -410,6 +411,18 @@ class File
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class MatchData
|
||||||
|
def pretty_print(pp)
|
||||||
|
pp.object_group(self) {
|
||||||
|
pp.breakable
|
||||||
|
1.upto(self.size) {|i|
|
||||||
|
pp.breakable unless pp.first?
|
||||||
|
pp.pp self[i-1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Object
|
class Object
|
||||||
include PP::ObjectMixin
|
include PP::ObjectMixin
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user