summaryrefslogtreecommitdiffstats
path: root/sample/fullpath.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-28 05:00:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-28 05:00:47 +0000
commit31b9d2870e10dd0de788f9cfbf2d759cf3cbb8bf (patch)
tree571574af57859810d146f28177c240f1fe04e4f7 /sample/fullpath.rb
parent6202f851c777a8327491ddca8f2df39b20ff9b5a (diff)
downloadruby-31b9d2870e10dd0de788f9cfbf2d759cf3cbb8bf.tar.gz
ruby-31b9d2870e10dd0de788f9cfbf2d759cf3cbb8bf.tar.xz
ruby-31b9d2870e10dd0de788f9cfbf2d759cf3cbb8bf.zip
changes from personal modifies -- matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/fullpath.rb')
-rw-r--r--sample/fullpath.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/sample/fullpath.rb b/sample/fullpath.rb
index ce268e20b..252e7dc21 100644
--- a/sample/fullpath.rb
+++ b/sample/fullpath.rb
@@ -8,16 +8,16 @@ end
if path == nil
path = ""
-elsif path !~ /\/$/
+elsif path !~ %r|/$|
path += "/"
end
-while gets()
- if /:$/
+while line = gets()
+ case line
+ when /:$/
path = $_.chop.chop + "/"
- elsif /^total/ || /^d/
- elsif /^(.*\d )(.+)$/
+ when /^total/, /^d/
+ when /^(.*\d )(.+)$/
print($1, path, $2, "\n")
end
end
-