repo.or.cz
/
ruby.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git]
/
sample
/
fullpath.rb
blob
112ca58081df2659a4a8e4b4ed353347f017d039
1
#! /usr/local/bin/ruby
2
# convert ls-lR filename into fullpath.
3
4
if ARGV[0] =~ /-p/
5
ARGV.shift
6
path = ARGV.shift
7
end
8
9
if path == nil
10
path = ""
11
elsif path !~ %r|/$|
12
path += "/"
13
end
14
15
while line = gets()
16
case line
17
when /:$/
18
path = line.chop.chop + "/"
19
when /^total/, /^d/
20
when /^(.*\d )(.+)$/
21
print($1, path, $2, "\n")
22
end
23
end