Class: Robocopy
- Inherits:
-
Object
- Object
- Robocopy
- Defined in:
- lib/rakeoff/robocopy.rb
Instance Method Summary collapse
- #execute(source, destination, parameters = '/MIR /R:5 /W:5 /NP /NFL /NDL') ⇒ Object
-
#initialize(tools_dir) ⇒ Robocopy
constructor
A new instance of Robocopy.
Constructor Details
#initialize(tools_dir) ⇒ Robocopy
Returns a new instance of Robocopy.
5 6 7 |
# File 'lib/rakeoff/robocopy.rb', line 5 def initialize(tools_dir) @tools_dir = tools_dir end |
Instance Method Details
#execute(source, destination, parameters = '/MIR /R:5 /W:5 /NP /NFL /NDL') ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rakeoff/robocopy.rb', line 9 def execute(source, destination, parameters='/MIR /R:5 /W:5 /NP /NFL /NDL') print_heading 'Copying' status = run_command("#{@tools_dir}/robocopy.exe #{source} #{destination} /XD .svn #{parameters}") failed = check_status(status) if failed raise RobocopyException, "Robocopy failed with status code #{status}. Please see http://bit.ly/dzegQL for what it means.".red end end |