Top Level Namespace
Defined Under Namespace
Modules: Net, Vortex Classes: FileMon
Instance Method Summary collapse
- #download(url, vortex) ⇒ Object
-
#print_usage ⇒ Object
vrtx-sync Author: Thomas Flemming, thomasfl(at)usit.uio.no MIT License 2010.
Instance Method Details
#download(url, vortex) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'bin/vrtx-sync', line 19 def download(url, vortex) filename = url[/[^\/]*$/,0] file = File.new(filename, "w") begin file.puts vortex.get(url).to_s rescue Net::HTTPServerException => e puts "Server error: " + e.to_s + " " + url exit end path = file.path file.close return path end |
#print_usage ⇒ Object
vrtx-sync Author: Thomas Flemming, thomasfl(at)usit.uio.no MIT License 2010
10 11 12 13 14 15 16 17 |
# File 'bin/vrtx-sync', line 10 def print_usage puts "usage: #{$0} URI [URI2 URI3..]" puts "" puts "Downloads resource from webdav server. File is " puts "uploaded back to webdav server when file us updated" puts "on local disk. " exit end |