Class: Terraspace::CLI::New::Source::Plugin

Inherits:
Core
  • Object
show all
Defined in:
lib/terraspace/cli/new/source/plugin.rb

Instance Method Summary collapse

Methods inherited from Core

#initialize, #override_source_paths, #require_gem, #set_core_source, #set_plugin_gem_source, #template_name

Methods included from Util::Pretty

#pretty_path, #pretty_time

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

This class inherits a constructor from Terraspace::CLI::New::Source::Core

Instance Method Details

#set_source_paths(template, type) ⇒ Object

different interface than Source::Test

template: base, hcl, ruby
type: module, project, stack


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/terraspace/cli/new/source/plugin.rb', line 8

def set_source_paths(template, type)
  # project always uses the examples from the provider gem for configs
  # base always uses terraspace core templates
  # examples option always use examples from provider gems
  if (type == "project" || @options[:examples]) && template != "base" &&
     (@options[:plugin] != "none" && !@options[:plugin].nil?)
    set_plugin_gem_source(template, type)   # provider gems has examples
  else
    set_core_source(template, type)  # terraspace core has empty starter files
  end
end