Module: Tesler::Operators::Run
- Included in:
- Copier
- Defined in:
- lib/tesler/operators/run.rb
Overview
This class defines the effective copy operations
Instance Method Summary collapse
- #copy_dir(file_name, options) ⇒ Object
- #copy_file(file_name, options) ⇒ Object
- #set_directory(directory_name) ⇒ Object
Instance Method Details
#copy_dir(file_name, options) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/tesler/operators/run.rb', line 16 def copy_dir(file_name, ) # we add the destination in the options for the logger because it can't find it itself Tesler::Operators::Logger.copy_dir(file_name, .merge({:destination => @directory_name})) # recursive copy FileUtils.cp_r file_name, "#{destination_name(file_name, )}" end |
#copy_file(file_name, options) ⇒ Object
12 13 14 |
# File 'lib/tesler/operators/run.rb', line 12 def copy_file(file_name, ) self.as(Tesler::Config.operator).copy_dir(file_name, ) end |
#set_directory(directory_name) ⇒ Object
7 8 9 10 |
# File 'lib/tesler/operators/run.rb', line 7 def set_directory(directory_name) Tesler::Operators::Logger.set_directory(directory_name) FileUtils.mkdir_p @directory_name end |