Class: InspecPlugins::ResourcePack::GenerateCLI

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec-resource-pack/cli_command.rb

Instance Method Summary collapse

Instance Method Details

#resource_pack(new_resource_pack_name) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/inspec-resource-pack/cli_command.rb', line 27

def resource_pack(new_resource_pack_name)
  base_templates_path = File.absolute_path(File.join(__FILE__,'..','..','templates'))
  resource_pack_template = 'resource_pack'

  render_opts = {
    templates_path: base_templates_path,
    overwrite: options[:overwrite]
  }
  renderer = InspecPlugins::Init::Renderer.new(ui, render_opts)

  vars = { name: new_resource_pack_name }

  renderer.render_with_values(resource_pack_template, 'resource pack', vars)

  # ui.exit(:success) # or :usage_error
  ui.exit
end