diff options
Diffstat (limited to 'sample/fullpath.rb')
| -rw-r--r-- | sample/fullpath.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sample/fullpath.rb b/sample/fullpath.rb index ce268e20b9..112ca58081 100644 --- a/sample/fullpath.rb +++ b/sample/fullpath.rb @@ -3,21 +3,21 @@ if ARGV[0] =~ /-p/ ARGV.shift - path = ARGV.shift + path = ARGV.shift end if path == nil path = "" -elsif path !~ /\/$/ +elsif path !~ %r|/$| path += "/" end -while gets() - if /:$/ - path = $_.chop.chop + "/" - elsif /^total/ || /^d/ - elsif /^(.*\d )(.+)$/ +while line = gets() + case line + when /:$/ + path = line.chop.chop + "/" + when /^total/, /^d/ + when /^(.*\d )(.+)$/ print($1, path, $2, "\n") end end - |
