Class: Terraspace::Seeder::Where

Inherits:
Object
  • Object
show all
Defined in:
lib/terraspace/seeder/where.rb

Instance Method Summary collapse

Constructor Details

#initialize(mod, options = {}) ⇒ Where

Returns a new instance of Where.



3
4
5
# File 'lib/terraspace/seeder/where.rb', line 3

def initialize(mod, options={})
  @mod, @options = mod, options
end

Instance Method Details

#dest_pathObject



7
8
9
10
11
12
13
# File 'lib/terraspace/seeder/where.rb', line 7

def dest_path
  if @options[:where] == "app"
    seed_path("app")
  else
    seed_path("config")
  end
end

#seed_fileObject



19
20
21
# File 'lib/terraspace/seeder/where.rb', line 19

def seed_file
  [Terraspace.app, Terraspace.role, Terraspace.env, Terraspace.extra].compact.join("/")
end

#seed_path(folder) ⇒ Object



15
16
17
# File 'lib/terraspace/seeder/where.rb', line 15

def seed_path(folder)
  "#{Terraspace.root}/#{folder}/#{@mod.build_dir(disable_extra: true)}/tfvars/#{seed_file}.tfvars"
end