bin/dav in net_dav-0.3.3 vs bin/dav in net_dav-0.4.0
- old
+ new
@@ -19,10 +19,11 @@
puts " lsr List file or directory recursively at URL"
puts " get Get file from URL to stdout or to FILE"
puts " put Put file from FILE to URL"
puts " mkdir Create directory at URL"
puts " gsub Replace content at URL from REGEXP to VALUE"
+ puts " props Display xml properties for file or directory at URL"
exit
end
if $*.size < 2
print_usage
@@ -60,17 +61,17 @@
dav.put(url.path, stream, File.size(file))
end
when 'get'
if file.nil?
dav.get(url.path) do |str|
- $stdout.print str
+ $stdout.print str
end
else
File.open(file, "w") do |stream|
- dav.get(url.path) do |str|
- stream.print str
- end
+ dav.get(url.path) do |str|
+ stream.print str
+ end
end
end
when 'lsr'
dav.find(url.path, :recursive => true) do |item|
puts "#{item.size}\t#{item.uri}"
@@ -84,12 +85,14 @@
when 'gsub'
re = Regexp.compile($*[2])
val = $*[3]
dav.find(url.path) do |item|
if (item.type == :file)
- item.content = item.content.gsub(re, val)
+ item.content = item.content.gsub(re, val)
end
end
+ when 'props'
+ puts dav.propfind(url.path).to_s
else
print_usage
end
}