From 4795daf1bce88cca8c3b14dc5c75a349838ee98a Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 25 Mar 2002 18:24:46 +0000 Subject: * lib/pp.rb (pp): return nil like p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/pp.rb | 3 +++ lib/tsort.rb | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eea775963c..bb1c18bdc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Mar 26 03:23:50 2002 Tanaka Akira + + * lib/pp.rb (pp): return nil like p. + Tue Mar 26 01:48:01 2002 Akinori MUSHA * ext/bigfloat/extconf.rb: Downcase the module name. (BigFloat.so diff --git a/lib/pp.rb b/lib/pp.rb index 0a18a6f318..1698084e63 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -55,6 +55,8 @@ I like the latter. If you do too, this library is for you. : pp(obj) output ((|obj|)) to (({$>})) in pretty printed format. + It returns (({nil})). + == Customized output To define your customized pretty printing function for your class, redefine a method (({pretty_print(((|pp|)))})) in the class. @@ -110,6 +112,7 @@ module Kernel objs.each {|obj| PP.pp(obj) } + nil end end diff --git a/lib/tsort.rb b/lib/tsort.rb index 58e073dff4..2c3c4b2c4e 100644 --- a/lib/tsort.rb +++ b/lib/tsort.rb @@ -55,7 +55,7 @@ TSort uses Hash internally. --- strongly_connected_components returns strongly connected components as an array of array of nodes. - The array is sorted as children to parents. + The array is sorted from children to parents. Each elements of the array represents a strongly connected component. --- each_strongly_connected_component {|nodes| ...} @@ -114,7 +114,8 @@ Very simple `make' like tool can be implemented as follows: outputs_time = nil end if outputs_time == nil || - inputs_time != nil && outputs_time < inputs_time # `<=' is better? + inputs_time != nil && outputs_time <= inputs_time + sleep 1 if inputs_time != nil && inputs_time.to_i == Time.now.to_i block.call end end -- cgit v1.2.3