Class: Sfn::Command

Inherits:
Bogo::Cli::Command
  • Object
show all
Includes:
Sfn::CommandModule::Callbacks
Defined in:
lib/sfn/command.rb,
lib/sfn/command/conf.rb,
lib/sfn/command/diff.rb,
lib/sfn/command/init.rb,
lib/sfn/command/lint.rb,
lib/sfn/command/list.rb,
lib/sfn/command/plan.rb,
lib/sfn/command/graph.rb,
lib/sfn/command/print.rb,
lib/sfn/command/trace.rb,
lib/sfn/command/create.rb,
lib/sfn/command/events.rb,
lib/sfn/command/export.rb,
lib/sfn/command/import.rb,
lib/sfn/command/update.rb,
lib/sfn/command/destroy.rb,
lib/sfn/command/inspect.rb,
lib/sfn/command/promote.rb,
lib/sfn/command/realize.rb,
lib/sfn/command/describe.rb,
lib/sfn/command/validate.rb,
lib/sfn/command/graph/aws.rb,
lib/sfn/command/graph/provider.rb,
lib/sfn/command/graph/terraform.rb

Defined Under Namespace

Classes: Conf, Create, Describe, Destroy, Diff, Events, Export, Graph, Import, Init, Inspect, Lint, List, Plan, Print, Promote, Realize, Trace, Update, Validate

Constant Summary collapse

CONFIG_BASE_NAME =

Base name of configuration file

".sfn"
VALID_CONFIG_EXTENSIONS =

Supported configuration file extensions

[
  "",
  ".rb",
  ".json",
  ".yaml",
  ".yml",
  ".xml",
]

Instance Method Summary collapse

Methods included from Sfn::CommandModule::Callbacks

#api_action!, #callbacks_for, #run_callbacks_for

Constructor Details

#initialize(cli_opts, args) ⇒ Command

Override to provide config file searching



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/sfn/command.rb', line 43

def initialize(cli_opts, args)
  unless cli_opts["config"]
    discover_config(cli_opts)
  end
  unless ENV["DEBUG"]
    ENV["DEBUG"] = "true" if cli_opts[:debug]
  end
  super(cli_opts, args)
  load_api_provider_extensions!
  run_callbacks_for(:after_config)
  run_callbacks_for("after_config_#{Bogo::Utility.snake(self.class.name.split("::").last)}")
end

Instance Method Details

#configSmash

Returns:

  • (Smash)


57
58
59
60
61
# File 'lib/sfn/command.rb', line 57

def config
  memoize(:config) do
    super
  end
end