Class: Terraspace::Seeder::Where
- Inherits:
-
Object
- Object
- Terraspace::Seeder::Where
- Defined in:
- lib/terraspace/seeder/where.rb
Instance Method Summary collapse
- #app_path ⇒ Object
- #dest_path ⇒ Object
- #infer_dest_path ⇒ Object
-
#initialize(mod, options = {}) ⇒ Where
constructor
A new instance of Where.
- #seed_file ⇒ Object
- #seed_path ⇒ Object
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, ={}) @mod, @options = mod, end |
Instance Method Details
#app_path ⇒ Object
22 23 24 |
# File 'lib/terraspace/seeder/where.rb', line 22 def app_path "#{Terraspace.root}/app/#{@mod.build_dir}/tfvars/#{seed_file}.tfvars" end |
#dest_path ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# 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 ⇒ Object
18 19 20 |
# File 'lib/terraspace/seeder/where.rb', line 18 def infer_dest_path @mod.type == "stack" ? app_path : seed_path end |
#seed_file ⇒ Object
30 31 32 |
# File 'lib/terraspace/seeder/where.rb', line 30 def seed_file @options[:instance] || Terraspace.env end |
#seed_path ⇒ Object
26 27 28 |
# File 'lib/terraspace/seeder/where.rb', line 26 def seed_path "#{Terraspace.root}/seed/tfvars/#{@mod.build_dir}/#{seed_file}.tfvars" end |