Class: Terraspace::CLI::New::Example

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/terraspace/cli/new/example.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.optionsObject



8
9
10
11
12
13
14
15
# File 'lib/terraspace/cli/new/example.rb', line 8

def self.options
  # default is nil for autodetection
  [
    [:force, aliases: %w[f], type: :boolean, desc: "Force overwrite"],
    [:lang, default: "hcl", desc: "Language to use: HCL/ERB or Ruby DSL"],
    [:plugin, aliases: %w[p], default: nil, type: :string],
  ]
end

Instance Method Details

#createObject



18
19
20
21
# File 'lib/terraspace/cli/new/example.rb', line 18

def create
  Module.start(["example", "--examples"] + cli_args)
  Stack.start([name, "--examples"] + cli_args)
end