# File lib/fig/command/action.rb, line 19 def primary_option() return options()[0] end
module Fig::Command::Action
One of the main activities Fig
should do as part of the current run.
This exists because the code used to have complicated logic about whether a package.fig should be read, whether the Package object should be loaded, should a config be applied, when should some activity happen, etc. Now, we let the Action
object say what it wants in terms of setup and then tell it to do whatever it needs to.
Constants
- EXIT_FAILURE
- EXIT_SUCCESS
Attributes
Public Instance Methods
# File lib/fig/command/action.rb, line 42 def allow_both_descriptor_and_file?() return false end
true, false, or nil if don't care.
# File lib/fig/command/action.rb, line 87 def apply_base_config?() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
true, false, or nil if don't care.
# File lib/fig/command/action.rb, line 80 def apply_config?() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 68 def base_package_can_come_from_descriptor?() return true end
Does the action care about command-line options that affect package contents, i.e. –resource/–archive?
# File lib/fig/command/action.rb, line 48 def cares_about_asset_options?() return false end
Slurp data out of command-line options.
# File lib/fig/command/action.rb, line 127 def configure(options) # Do nothing by default. return end
# File lib/fig/command/action.rb, line 36 def descriptor_requirement() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 132 def execute() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
Is this a special Action
that should just be run on its own without looking at other Actions? Note that anything that returns true won't get an execution context.
# File lib/fig/command/action.rb, line 32 def execute_immediately_after_command_line_parse? return false end
Is this –list-dependencies?
# File lib/fig/command/action.rb, line 102 def list_dependencies?() return false end
Is this –list-variables?
# File lib/fig/command/action.rb, line 107 def list_variables?() return false end
# File lib/fig/command/action.rb, line 62 def load_base_package?() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 52 def modifies_repository?() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 23 def options() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 58 def prepare_repository(repository) return # Nothing by default. end
Is this a publish action?
# File lib/fig/command/action.rb, line 112 def publish?() return false end
true, false, or nil if don't care.
# File lib/fig/command/action.rb, line 73 def register_base_package?() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/command/action.rb, line 93 def remote_operation_necessary?() return false end
Answers whether we should reset the environment to nothing, sort of like the standardized environment that cron(1) creates. At present, we're only setting this when we're listing variables. One could imagine allowing this to be set by a command-line option in general; if we do this, the RuntimeEnvironment class will need to be changed to support deletion of values from ENV.
# File lib/fig/command/action.rb, line 122 def reset_environment?() return false end
# File lib/fig/command/action.rb, line 97 def retrieves_should_happen?() return false end