Class: MKBrut::Ops::CopyFile
- Defined in:
- lib/mkbrut/ops/copy_file.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source, destination_root:) ⇒ CopyFile
constructor
A new instance of CopyFile.
- #to_s ⇒ Object
Methods inherited from BaseOp
dry_run=, dry_run?, #dry_run?, fileutils_args, #fileutils_args
Constructor Details
#initialize(source, destination_root:) ⇒ CopyFile
Returns a new instance of CopyFile.
4 5 6 7 |
# File 'lib/mkbrut/ops/copy_file.rb', line 4 def initialize(source, destination_root:) @source = source @destination_root = destination_root end |
Instance Method Details
#call ⇒ Object
8 9 10 |
# File 'lib/mkbrut/ops/copy_file.rb', line 8 def call FileUtils.cp(@source, @destination_root / @source.basename, **fileutils_args) end |
#to_s ⇒ Object
11 |
# File 'lib/mkbrut/ops/copy_file.rb', line 11 def to_s = "Copy '#{@source}' to '#{@destination_root}'" |