summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-25 18:24:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-25 18:24:46 +0000
commit590efc55f905d338d1fb11e24335b380781782ff (patch)
tree435117aeb9991ed29d95333456ea504ca3563911 /lib
parent71f5e7df6f0b1b754d0c6e02cf686fc30b4a948c (diff)
downloadruby-590efc55f905d338d1fb11e24335b380781782ff.tar.gz
ruby-590efc55f905d338d1fb11e24335b380781782ff.tar.xz
ruby-590efc55f905d338d1fb11e24335b380781782ff.zip
* lib/pp.rb (pp): return nil like p.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/pp.rb3
-rw-r--r--lib/tsort.rb5
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index 0a18a6f31..1698084e6 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 58e073dff..2c3c4b2c4 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