Class: Mayu::Resources::Generators::CopyFile
- Extended by:
- T::Sig
- Defined in:
- lib/mayu/resources/generators/copy_file.rb
Instance Method Summary collapse
-
#initialize(source_path) ⇒ CopyFile
constructor
A new instance of CopyFile.
- #process(target_path) ⇒ Object
Constructor Details
#initialize(source_path) ⇒ CopyFile
Returns a new instance of CopyFile.
14 15 16 |
# File 'lib/mayu/resources/generators/copy_file.rb', line 14 def initialize(source_path) @source_path = source_path end |
Instance Method Details
#process(target_path) ⇒ Object
19 20 21 22 |
# File 'lib/mayu/resources/generators/copy_file.rb', line 19 def process(target_path) return if File.exist?(target_path) FileUtils.copy_file(@source_path, target_path) end |