Class: Tesler::Copier
- Includes:
- Operators::Base, Operators::Logger, Operators::Run
- Defined in:
- lib/tesler/copier.rb
Overview
This the class which receives the DSL commands.
Class Method Summary collapse
-
.directory(directory_name, &block) ⇒ Object
Method called by the DSL method ‘directory’.
Instance Method Summary collapse
-
#copy(file_name, options = {}) ⇒ Object
Method called by the DSL method ‘copy’.
-
#directory(directory_name, &block) ⇒ Object
This method create a sub-directory.
-
#initialize(directory_name) ⇒ Copier
constructor
A new instance of Copier.
Methods included from Operators::Run
#copy_dir, #copy_file, #set_directory
Methods included from Operators::Logger
#copy_dir, #copy_file, destination_name, #set_directory
Methods included from Operators::Base
Constructor Details
Class Method Details
Instance Method Details
#copy(file_name, options = {}) ⇒ Object
Method called by the DSL method ‘copy’
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tesler/copier.rb', line 14 def copy(file_name, ={}) filename = file_name.tesler if not Tesler::Config.source_directory.blank? filename = "#{Tesler::Config.source_directory}/#{filename}" end # if the file's name contains a star, then it is considered as a regular expression if filename.include? "*" regexp_copy(filename, ) # the file's name is not a regular expression, so we copy it directly else direct_copy(filename, ) end end |