Class: TerraspaceBundler::Exporter::Copy

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace_bundler/exporter/copy.rb

Instance Method Summary collapse

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

#modObject



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_pathObject

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

#stacksObject



15
16
17
# File 'lib/terraspace_bundler/exporter/copy.rb', line 15

def stacks
  Stacks.new(@mod).export
end