From 089d61b4247f5e7e95bfa7dd3c0daa6cbe45fe92 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 22 Apr 1998 08:55:40 +0000 Subject: find.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/find.rb | 2 +- lib/pstore.rb | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/find.rb b/lib/find.rb index 5ecc54329c..7a6dbce17a 100644 --- a/lib/find.rb +++ b/lib/find.rb @@ -12,7 +12,7 @@ module Find while file = path.shift catch(:prune) { yield file - if File.directory? file and not File.symlink? file then + if File.directory? file then d = Dir.open(file) begin for f in d diff --git a/lib/pstore.rb b/lib/pstore.rb index 2a0bc11e48..b93420d649 100644 --- a/lib/pstore.rb +++ b/lib/pstore.rb @@ -108,13 +108,15 @@ class PStore end end -db = PStore.new("/tmp/foo") -db.transaction do - p db.roots - ary = db["root"] = [1,2,3,4] - ary[0] = [1,1.5] -end +if __FILE__ == $0 + db = PStore.new("/tmp/foo") + db.transaction do + p db.roots + ary = db["root"] = [1,2,3,4] + ary[0] = [1,1.5] + end -db.transaction do - p db["root"] + db.transaction do + p db["root"] + end end -- cgit v1.2.3