Sha256: 3bd2fb9a73e1ba50bb87011fa5c6d23af9fc165fc9ff3a290efb2c1cfef3dac4

Contents?: true

Size: 745 Bytes

Versions: 20

Compression:

Stored size: 745 Bytes

Contents

class Terraspace::CLI::New
  class Module < Sequence
    component_options.each { |args| class_option(*args) }

    argument :name

    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

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

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
terraspace-0.4.4 lib/terraspace/cli/new/module.rb
terraspace-0.4.3 lib/terraspace/cli/new/module.rb
terraspace-0.4.2 lib/terraspace/cli/new/module.rb
terraspace-0.4.1 lib/terraspace/cli/new/module.rb
terraspace-0.4.0 lib/terraspace/cli/new/module.rb
terraspace-0.3.6 lib/terraspace/cli/new/module.rb
terraspace-0.3.5 lib/terraspace/cli/new/module.rb
terraspace-0.3.4 lib/terraspace/cli/new/module.rb
terraspace-0.3.3 lib/terraspace/cli/new/module.rb
terraspace-0.3.2 lib/terraspace/cli/new/module.rb
terraspace-0.3.1 lib/terraspace/cli/new/module.rb
terraspace-0.3.0 lib/terraspace/cli/new/module.rb
terraspace-0.2.4 lib/terraspace/cli/new/module.rb
terraspace-0.2.3 lib/terraspace/cli/new/module.rb
terraspace-0.2.2 lib/terraspace/cli/new/module.rb
terraspace-0.2.1 lib/terraspace/cli/new/module.rb
terraspace-0.2.0 lib/terraspace/cli/new/module.rb
terraspace-0.1.2 lib/terraspace/cli/new/module.rb
terraspace-0.1.1 lib/terraspace/cli/new/module.rb
terraspace-0.1.0 lib/terraspace/cli/new/module.rb