class Terraspace::Seeder::Where

Public Class Methods

new(mod, options={}) click to toggle source
# File lib/terraspace/seeder/where.rb, line 3
def initialize(mod, options={})
  @mod, @options = mod, options
end

Public Instance Methods

app_path() click to toggle source
# File lib/terraspace/seeder/where.rb, line 22
def app_path
  "#{Terraspace.root}/app/#{@mod.build_dir}/tfvars/#{seed_file}.tfvars"
end
dest_path() click to toggle source
# File lib/terraspace/seeder/where.rb, line 7
def dest_path
  case @options[:where]
  when "app"
    app_path
  when "seed"
    seed_path
  else
    infer_dest_path
  end
end
infer_dest_path() click to toggle source
# File lib/terraspace/seeder/where.rb, line 18
def infer_dest_path
  @mod.type == "stack" ? app_path : seed_path
end
seed_file() click to toggle source
# File lib/terraspace/seeder/where.rb, line 30
def seed_file
  @options[:instance] || Terraspace.env
end
seed_path() click to toggle source
# File lib/terraspace/seeder/where.rb, line 26
def seed_path
  "#{Terraspace.root}/seed/tfvars/#{@mod.build_dir}/#{seed_file}.tfvars"
end