Class: Terraspace::CLI::New::Module

Inherits:
Sequence
  • Object
show all
Defined in:
lib/terraspace/cli/new/module.rb

Instance Method Summary collapse

Methods inherited from Sequence

base_options, component_options

Instance Method Details

#create_moduleObject



7
8
9
10
11
12
13
# File 'lib/terraspace/cli/new/module.rb', line 7

def create_module
  puts "=> Creating test for new module: #{name}"
  plugin_template_source(@options[:lang], "module") # IE: plugin_template_source("hcl", "module")
  dest = "app/modules/#{name}"
  dest = "#{@options[:project_name]}/#{dest}" if @options[:project_name]
  directory ".", dest
end

#create_testObject



15
16
17
18
# File 'lib/terraspace/cli/new/module.rb', line 15

def create_test
  args = component_args(name, @options[:project_name])
  Test::Module.start(args)
end

#run_generator_hook_scriptObject



20
21
22
23
24
# File 'lib/terraspace/cli/new/module.rb', line 20

def run_generator_hook_script
  script = ENV['TS_GENERATOR_MODULE']
  return unless script
  run_script(script, "app/modules/#{name}")
end