Class: WorkflowPluginBase
- Inherits:
-
Thor
- Object
- Thor
- WorkflowPluginBase
- Defined in:
- lib/core/workflow_plugin_base.rb
Overview
Base class for all workflow plugins
Direct Known Subclasses
Constant Summary collapse
- DESCF_FORMAT =
"%-8s %s"- DESC_HELP =
format(DESCF_FORMAT, "help", "[COMMAND]")
Class Method Summary collapse
-
.descf(usage, args, description, options = {}) ⇒ Object
Improves formatting for desc so that args are lain out nicely.
-
.help_desc(help_desc) ⇒ Object
rubocop:disable all.
- .help_text ⇒ Object
-
.subcommand_help(cmd) ⇒ Object
Overrides the existing thor subcommand_help to improve formatting.
Instance Method Summary collapse
- #help(command = nil, subcommand = false) ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ WorkflowPluginBase
constructor
A new instance of WorkflowPluginBase.
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ WorkflowPluginBase
Returns a new instance of WorkflowPluginBase.
8 9 10 11 |
# File 'lib/core/workflow_plugin_base.rb', line 8 def initialize(args = [], = {}, config = {}) super(args, , config) @logger = LogHelper.load_logger(self.class.name, @options) end |
Class Method Details
.descf(usage, args, description, options = {}) ⇒ Object
Improves formatting for desc so that args are lain out nicely
34 35 36 |
# File 'lib/core/workflow_plugin_base.rb', line 34 def descf(usage, args, description, = {}) desc(format(DESCF_FORMAT, usage, args), description, ) end |
.help_desc(help_desc) ⇒ Object
rubocop:disable all
25 26 27 |
# File 'lib/core/workflow_plugin_base.rb', line 25 def help_desc(help_desc) @help_desc = help_desc end |
.help_text ⇒ Object
29 30 31 |
# File 'lib/core/workflow_plugin_base.rb', line 29 def help_text @help_desc end |
.subcommand_help(cmd) ⇒ Object
Overrides the existing thor subcommand_help to improve formatting.
39 40 41 42 |
# File 'lib/core/workflow_plugin_base.rb', line 39 def subcommand_help(cmd) desc DESC_HELP, "Describe subcommands or one specific subcommand" class_eval "def help(command = nil, subcommand = true); super; end" end |
Instance Method Details
#help(command = nil, subcommand = false) ⇒ Object
19 20 21 |
# File 'lib/core/workflow_plugin_base.rb', line 19 def help(command = nil, subcommand = false) super command, subcommand end |