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

execution_context[W]

Public Instance Methods

allow_both_descriptor_and_file?() click to toggle source
# File lib/fig/command/action.rb, line 42
def allow_both_descriptor_and_file?()
  return false
end
apply_base_config?() click to toggle source

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
apply_config?() click to toggle source

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
base_package_can_come_from_descriptor?() click to toggle source
# File lib/fig/command/action.rb, line 68
def base_package_can_come_from_descriptor?()
  return true
end
cares_about_asset_options?() click to toggle source

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
configure(options) click to toggle source

Slurp data out of command-line options.

# File lib/fig/command/action.rb, line 127
def configure(options)
  # Do nothing by default.
  return
end
descriptor_requirement() click to toggle source
# File lib/fig/command/action.rb, line 36
def descriptor_requirement()
  raise NotImplementedError.new(
    "#{__callee__}() not implemented on #{self.class}."
  )
end
execute() click to toggle source
# File lib/fig/command/action.rb, line 132
def execute()
  raise NotImplementedError.new(
    "#{__callee__}() not implemented on #{self.class}."
  )
end
execute_immediately_after_command_line_parse?() click to toggle source

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
list_dependencies?() click to toggle source

Is this –list-dependencies?

# File lib/fig/command/action.rb, line 102
def list_dependencies?()
  return false
end
list_variables?() click to toggle source

Is this –list-variables?

# File lib/fig/command/action.rb, line 107
def list_variables?()
  return false
end
load_base_package?() click to toggle source
# File lib/fig/command/action.rb, line 62
def load_base_package?()
  raise NotImplementedError.new(
    "#{__callee__}() not implemented on #{self.class}."
  )
end
modifies_repository?() click to toggle source
# File lib/fig/command/action.rb, line 52
def modifies_repository?()
  raise NotImplementedError.new(
    "#{__callee__}() not implemented on #{self.class}."
  )
end
options() click to toggle source
# File lib/fig/command/action.rb, line 23
def options()
  raise NotImplementedError.new(
    "#{__callee__}() not implemented on #{self.class}."
  )
end
prepare_repository(repository) click to toggle source
# File lib/fig/command/action.rb, line 58
def prepare_repository(repository)
  return # Nothing by default.
end
primary_option() click to toggle source
# File lib/fig/command/action.rb, line 19
def primary_option()
  return options()[0]
end
publish?() click to toggle source

Is this a publish action?

# File lib/fig/command/action.rb, line 112
def publish?()
  return false
end
register_base_package?() click to toggle source

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
remote_operation_necessary?() click to toggle source
# File lib/fig/command/action.rb, line 93
def remote_operation_necessary?()
  return false
end
reset_environment?() click to toggle source

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
retrieves_should_happen?() click to toggle source
# File lib/fig/command/action.rb, line 97
def retrieves_should_happen?()
  return false
end