[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / sample / fullpath.rb
blob112ca58081df2659a4a8e4b4ed353347f017d039
1 #! /usr/local/bin/ruby
2 # convert ls-lR filename into fullpath.
4 if ARGV[0] =~ /-p/
5   ARGV.shift
6   path = ARGV.shift
7 end
9 if path == nil
10   path = ""
11 elsif path !~ %r|/$|
12   path += "/"
13 end
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