Class: Terraspace::CLI::New::Plugin::Ci

Inherits:
Sequence
  • Object
show all
Includes:
Helper
Defined in:
lib/terraspace/cli/new/plugin/ci.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Sequence

base_options, component_options

Methods included from Util::Logging

#logger

Class Method Details

.optionsObject



7
8
9
10
11
# File 'lib/terraspace/cli/new/plugin/ci.rb', line 7

def self.options
  [
    [:force, aliases: %w[y], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"],
  ]
end

Instance Method Details

#create_pluginObject



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

def create_plugin
  puts "=> Creating new ci plugin: #{name}"
  core_template_source("plugin/ci")
  directory ".", "terraspace_ci_#{name}"
end

#finish_messageObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/terraspace/cli/new/plugin/ci.rb', line 20

def finish_message
  files = [
    "#{gem_name}.gemspec",
    "lib/#{gem_name}.rb",
    "lib/#{gem_name}/vars.rb",
    "lib/#{gem_name}/interface.rb",
    "README.md",
  ]
  files.sort!
  list = files.map { |file| "    #{file}" }.join("\n")
  puts <<~EOL
  Files in #{gem_name} to review and update:

  #{list}
  EOL
end