Class: Jets::Command::PluginCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/commands/plugin/plugin_command.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

base_name, command_name, default_command_root, desc, engine?, executable, exit_on_failure?, hide_command!, inherited, long_desc, namespace, perform, printing_commands, usage_path

Methods included from ApiHelpers

#check_for_error_message!, #no_token_exit!, #paging_params

Methods included from AwsHelpers

#find_stack, #first_run?

Methods included from AwsServices

#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts

Methods included from AwsServices::StackStatus

#lookup, #stack_exists?, #stack_in_progress?

Methods included from AwsServices::GlobalMemoist

included

Methods included from Actions

#load_generators, #load_tasks, #require_application!, #require_application_and_environment!, #set_application_directory!

Class Method Details

:nodoc:



12
13
14
# File 'lib/jets/commands/plugin/plugin_command.rb', line 12

def self.banner(*) # :nodoc:
  "#{executable} new [options]"
end

Instance Method Details

#helpObject



8
9
10
# File 'lib/jets/commands/plugin/plugin_command.rb', line 8

def help
  run_plugin_generator %w( --help )
end

#perform(type = nil, *plugin_args) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/jets/commands/plugin/plugin_command.rb', line 21

def perform(type = nil, *plugin_args)
  plugin_args << "--help" unless type == "new"

  unless options.key?("no_rc") # Thor's not so indifferent access hash.
    jetsrc = File.expand_path(options[:rc])

    if File.exist?(jetsrc)
      extra_args = File.read(jetsrc).split(/\n+/).flat_map(&:split)
      say "Using #{extra_args.join(" ")} from #{jetsrc}"
      plugin_args.insert(1, *extra_args)
    end
  end

  run_plugin_generator plugin_args
end