Class: TerraBoi::TfEnvGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TerraBoi::TfEnvGenerator
- Defined in:
- lib/generators/terra_boi/tf_env_generator.rb
Constant Summary collapse
- TEMPLATES =
{ ecs_cluster: [ "ecs_cluster.tf", ], head_worker: [ "ecs.tf", ], web_app: [ "ecs.tf", ], data: [ "main.tf", "output.tf", ] }
Instance Attribute Summary collapse
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#class_options ⇒ Object
Returns the value of attribute class_options.
Instance Method Summary collapse
Instance Attribute Details
#application_name ⇒ Object
Returns the value of attribute application_name.
5 6 7 |
# File 'lib/generators/terra_boi/tf_env_generator.rb', line 5 def application_name @application_name end |
#class_options ⇒ Object
Returns the value of attribute class_options.
5 6 7 |
# File 'lib/generators/terra_boi/tf_env_generator.rb', line 5 def @class_options end |
Instance Method Details
#create_ecs ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/generators/terra_boi/tf_env_generator.rb', line 42 def create_ecs [:envs].each do |env| TEMPLATES.each do |dir, file_arr| file_arr.each do |filename| template "env/#{dir}/#{filename}.erb", "terraform/#{env}/#{dir}/#{filename}", { env: env, } end end end end |
#init ⇒ Object
36 37 38 39 40 |
# File 'lib/generators/terra_boi/tf_env_generator.rb', line 36 def init # defined in lib/generators/extensions self.application_name = generate_application_name separators: false self. = end |