Class: Cfruby::FileOps::HTTPFileCommand
- Inherits:
-
Object
- Object
- Cfruby::FileOps::HTTPFileCommand
- Defined in:
- lib/libcfruby/fileops.rb
Overview
FileCommand interface for http operations
Instance Method Summary collapse
-
#copy(filename, targetdir, options = {}) ⇒ Object
- Options:
:recursive
- Recursive
:flags
-
Passed directly to the rsync command.
- Recursive
- Options:
- #move(filename, newfilename, options = {}) ⇒ Object
Instance Method Details
#copy(filename, targetdir, options = {}) ⇒ Object
Options:
:recursive
-
Recursive
:flags
-
Passed directly to the rsync command
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/libcfruby/fileops.rb', line 270 def copy(filename, targetdir, = {}) flags = Array.new() if([:flags]) flags << [:flags] end wgetcommand="cd #{targetdir} && " if([:recursive]) wgetcommand=wgetcommand + "wget -q -np -nH -r -l inf --cut-dirs=#{filename.split(/\//).length} #{flags} http://#{filename}" else wgetcommand=wgetcommand + "wget -q #{flags} http://#{filename}" end Cfruby.controller.attempt(wgetcommand, 'destructive', 'unknown') { Cfruby::Exec.exec(wgetcommand) } end |
#move(filename, newfilename, options = {}) ⇒ Object
263 264 265 |
# File 'lib/libcfruby/fileops.rb', line 263 def move(filename, newfilename, = {}) raise(Exception, "HTTP move not implemented") end |