Skip to content

Commit

Permalink
merge from thomasfl
Browse files Browse the repository at this point in the history
  • Loading branch information
devrandom committed Nov 23, 2009
2 parents 63c7af0 + 3c057eb commit f823e1d
Show file tree
Hide file tree
Showing 8 changed files with 473 additions and 226 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -9,7 +9,7 @@ begin
gem.description = %Q{WebDAV client library in the style of Net::HTTP, using Net::HTTP and libcurl, if installed}
gem.email = "c1.github@niftybox.net"
gem.homepage = "http://github.com/devrandom/net_dav"
gem.authors = ["Miron Cuperman"]
gem.authors = ["Miron Cuperman","Thomas Flemming"]
gem.executables = ["dav"]
gem.add_dependency "nokogiri", ">= 1.3.0"
gem.add_development_dependency "rspec", ">= 1.2.0"
Expand Down
13 changes: 8 additions & 5 deletions bin/dav
Expand Up @@ -21,6 +21,7 @@ def print_usage
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

Expand Down Expand Up @@ -62,13 +63,13 @@ res = dav.start { |dav|
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'
Expand All @@ -86,9 +87,11 @@ res = dav.start { |dav|
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
Expand Down

0 comments on commit f823e1d

Please sign in to comment.