Class: TerraspaceBundler::Exporter::Copy
- Defined in:
- lib/terraspace_bundler/exporter/copy.rb
Instance Method Summary collapse
-
#initialize(mod) ⇒ Copy
constructor
A new instance of Copy.
- #mod ⇒ Object
-
#src_path ⇒ Object
src path is from the stage area.
- #stacks ⇒ Object
Constructor Details
#initialize(mod) ⇒ Copy
Returns a new instance of Copy.
3 4 5 |
# File 'lib/terraspace_bundler/exporter/copy.rb', line 3 def initialize(mod) @mod = mod end |
Instance Method Details
#mod ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/terraspace_bundler/exporter/copy.rb', line 7 def mod FileUtils.rm_rf(mod_path) FileUtils.mkdir_p(File.dirname(mod_path)) logger.debug "Copy: cp -r #{src_path} #{mod_path}" FileUtils.cp_r(src_path, mod_path) FileUtils.rm_rf("#{mod_path}/.git") end |
#src_path ⇒ Object
src path is from the stage area
20 21 22 23 24 |
# File 'lib/terraspace_bundler/exporter/copy.rb', line 20 def src_path path = stage_path(rel_dest_dir) path = "#{path}/#{@mod.subfolder}" if @mod.subfolder path end |