Module: Fig::Command::Action
- Included in:
- Clean, DumpPackageDefinitionForCommandLine, DumpPackageDefinitionParsed, DumpPackageDefinitionText, Get, Help, HelpLong, ListConfigs, ListDependencies, ListDependencies::AllConfigs, ListDependencies::Default, ListDependencies::Graphviz, ListDependencies::GraphvizAllConfigs, ListDependencies::Tree, ListDependencies::TreeAllConfigs, ListLocal, ListRemote, ListVariables, ListVariables::AllConfigs, ListVariables::Default, ListVariables::Graphviz, ListVariables::GraphvizAllConfigs, ListVariables::Tree, ListVariables::TreeAllConfigs, Options, Publish, PublishLocal, RunCommandLine, RunCommandStatement, SourcePackage, Update, UpdateIfMissing, Version, VersionPlain
- Defined in:
- lib/fig/command/action.rb,
lib/fig/command/action/get.rb,
lib/fig/command/action/help.rb,
lib/fig/command/action/clean.rb,
lib/fig/command/action/update.rb,
lib/fig/command/action/options.rb,
lib/fig/command/action/publish.rb,
lib/fig/command/action/version.rb,
lib/fig/command/action/help_long.rb,
lib/fig/command/action/list_local.rb,
lib/fig/command/action/list_remote.rb,
lib/fig/command/action/role/update.rb,
lib/fig/command/action/list_configs.rb,
lib/fig/command/action/role/publish.rb,
lib/fig/command/action/publish_local.rb,
lib/fig/command/action/version_plain.rb,
lib/fig/command/action/list_variables.rb,
lib/fig/command/action/source_package.rb,
lib/fig/command/action/run_command_line.rb,
lib/fig/command/action/list_dependencies.rb,
lib/fig/command/action/update_if_missing.rb,
lib/fig/command/action/list_variables/tree.rb,
lib/fig/command/action/role/has_sub_action.rb,
lib/fig/command/action/role/list_all_configs.rb,
lib/fig/command/action/role/list_as_graphviz.rb,
lib/fig/command/action/role/list_base_config.rb,
lib/fig/command/action/run_command_statement.rb,
lib/fig/command/action/list_dependencies/tree.rb,
lib/fig/command/action/list_variables/default.rb,
lib/fig/command/action/role/has_no_sub_action.rb,
lib/fig/command/action/list_variables/graphviz.rb,
lib/fig/command/action/list_dependencies/default.rb,
lib/fig/command/action/list_dependencies/graphviz.rb,
lib/fig/command/action/list_variables/all_configs.rb,
lib/fig/command/action/role/list_dependencies_flat.rb,
lib/fig/command/action/dump_package_definition_text.rb,
lib/fig/command/action/list_dependencies/all_configs.rb,
lib/fig/command/action/role/list_variables_in_a_tree.rb,
lib/fig/command/action/dump_package_definition_parsed.rb,
lib/fig/command/action/list_variables/tree_all_configs.rb,
lib/fig/command/action/role/list_variables_as_graphviz.rb,
lib/fig/command/action/role/list_dependencies_in_a_tree.rb,
lib/fig/command/action/role/list_walking_dependency_tree.rb,
lib/fig/command/action/list_dependencies/tree_all_configs.rb,
lib/fig/command/action/role/list_dependencies_as_graphviz.rb,
lib/fig/command/action/list_variables/graphviz_all_configs.rb,
lib/fig/command/action/list_dependencies/graphviz_all_configs.rb,
lib/fig/command/action/dump_package_definition_for_command_line.rb
Overview
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.
Defined Under Namespace
Modules: Role Classes: Clean, DumpPackageDefinitionForCommandLine, DumpPackageDefinitionParsed, DumpPackageDefinitionText, Get, Help, HelpLong, ListConfigs, ListDependencies, ListLocal, ListRemote, ListVariables, Options, Publish, PublishLocal, RunCommandLine, RunCommandStatement, SourcePackage, Update, UpdateIfMissing, Version, VersionPlain
Constant Summary collapse
- EXIT_SUCCESS =
0
- EXIT_FAILURE =
1
Instance Attribute Summary collapse
-
#execution_context ⇒ Object
writeonly
Sets the attribute execution_context.
Instance Method Summary collapse
- #allow_both_descriptor_and_file? ⇒ Boolean
-
#apply_base_config? ⇒ Boolean
true, false, or nil if don’t care.
-
#apply_config? ⇒ Boolean
true, false, or nil if don’t care.
- #base_package_can_come_from_descriptor? ⇒ Boolean
-
#cares_about_asset_options? ⇒ Boolean
Does the action care about command-line options that affect package contents, i.e.
-
#configure(options) ⇒ Object
Slurp data out of command-line options.
- #descriptor_requirement ⇒ Object
- #execute ⇒ Object
-
#execute_immediately_after_command_line_parse? ⇒ Boolean
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.
-
#list_dependencies? ⇒ Boolean
Is this –list-dependencies?.
-
#list_variables? ⇒ Boolean
Is this –list-variables?.
- #load_base_package? ⇒ Boolean
- #modifies_repository? ⇒ Boolean
- #options ⇒ Object
- #prepare_repository(repository) ⇒ Object
- #primary_option ⇒ Object
-
#publish? ⇒ Boolean
Is this a publish action?.
-
#register_base_package? ⇒ Boolean
true, false, or nil if don’t care.
- #remote_operation_necessary? ⇒ Boolean
-
#reset_environment? ⇒ Boolean
Answers whether we should reset the environment to nothing, sort of like the standardized environment that cron(1) creates.
- #retrieves_should_happen? ⇒ Boolean
Instance Attribute Details
#execution_context=(value) ⇒ Object (writeonly)
Sets the attribute execution_context
15 16 17 |
# File 'lib/fig/command/action.rb', line 15 def execution_context=(value) @execution_context = value end |
Instance Method Details
#allow_both_descriptor_and_file? ⇒ Boolean
36 37 38 |
# File 'lib/fig/command/action.rb', line 36 def allow_both_descriptor_and_file?() return false end |
#apply_base_config? ⇒ Boolean
true, false, or nil if don’t care.
73 74 75 |
# File 'lib/fig/command/action.rb', line 73 def apply_base_config?() raise NotImplementedError end |
#apply_config? ⇒ Boolean
true, false, or nil if don’t care.
68 69 70 |
# File 'lib/fig/command/action.rb', line 68 def apply_config?() raise NotImplementedError end |
#base_package_can_come_from_descriptor? ⇒ Boolean
58 59 60 |
# File 'lib/fig/command/action.rb', line 58 def base_package_can_come_from_descriptor?() return true end |
#cares_about_asset_options? ⇒ Boolean
Does the action care about command-line options that affect package contents, i.e. –resource/–archive?
42 43 44 |
# File 'lib/fig/command/action.rb', line 42 def () return false end |
#configure(options) ⇒ Object
Slurp data out of command-line options.
111 112 113 114 |
# File 'lib/fig/command/action.rb', line 111 def configure() # Do nothing by default. return end |
#descriptor_requirement ⇒ Object
32 33 34 |
# File 'lib/fig/command/action.rb', line 32 def descriptor_requirement() raise NotImplementedError end |
#execute ⇒ Object
116 117 118 |
# File 'lib/fig/command/action.rb', line 116 def execute() raise NotImplementedError end |
#execute_immediately_after_command_line_parse? ⇒ Boolean
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.
28 29 30 |
# File 'lib/fig/command/action.rb', line 28 def execute_immediately_after_command_line_parse? return false end |
#list_dependencies? ⇒ Boolean
Is this –list-dependencies?
86 87 88 |
# File 'lib/fig/command/action.rb', line 86 def list_dependencies?() return false end |
#list_variables? ⇒ Boolean
Is this –list-variables?
91 92 93 |
# File 'lib/fig/command/action.rb', line 91 def list_variables?() return false end |
#load_base_package? ⇒ Boolean
54 55 56 |
# File 'lib/fig/command/action.rb', line 54 def load_base_package?() raise NotImplementedError end |
#modifies_repository? ⇒ Boolean
46 47 48 |
# File 'lib/fig/command/action.rb', line 46 def modifies_repository?() raise NotImplementedError end |
#options ⇒ Object
21 22 23 |
# File 'lib/fig/command/action.rb', line 21 def () raise NotImplementedError end |
#prepare_repository(repository) ⇒ Object
50 51 52 |
# File 'lib/fig/command/action.rb', line 50 def prepare_repository(repository) return # Nothing by default. end |
#primary_option ⇒ Object
17 18 19 |
# File 'lib/fig/command/action.rb', line 17 def primary_option() return ()[0] end |
#publish? ⇒ Boolean
Is this a publish action?
96 97 98 |
# File 'lib/fig/command/action.rb', line 96 def publish?() return false end |
#register_base_package? ⇒ Boolean
true, false, or nil if don’t care.
63 64 65 |
# File 'lib/fig/command/action.rb', line 63 def register_base_package?() raise NotImplementedError end |
#remote_operation_necessary? ⇒ Boolean
77 78 79 |
# File 'lib/fig/command/action.rb', line 77 def remote_operation_necessary?() return false end |
#reset_environment? ⇒ Boolean
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.
106 107 108 |
# File 'lib/fig/command/action.rb', line 106 def reset_environment?() return false end |
#retrieves_should_happen? ⇒ Boolean
81 82 83 |
# File 'lib/fig/command/action.rb', line 81 def retrieves_should_happen?() return false end |