Class: Terraspace::Seeder::Where
- Inherits:
-
Object
- Object
- Terraspace::Seeder::Where
- Defined in:
- lib/terraspace/seeder/where.rb
Instance Method Summary collapse
- #dest_path ⇒ Object
-
#initialize(mod, options = {}) ⇒ Where
constructor
A new instance of Where.
- #seed_file ⇒ Object
- #seed_path(folder) ⇒ 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
#dest_path ⇒ Object
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_file ⇒ Object
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 |