Module: Tapioca::ConfigHelper
Defined Under Namespace
Classes: ConfigError, ConfigErrorMessagePart
Instance Attribute Summary collapse
-
#command_name ⇒ Object
readonly
Returns the value of attribute command_name.
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Instance Method Summary collapse
Instance Attribute Details
#command_name ⇒ Object (readonly)
Returns the value of attribute command_name.
14 15 16 |
# File 'lib/tapioca/helpers/config_helper.rb', line 14 def command_name @command_name end |
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
17 18 19 |
# File 'lib/tapioca/helpers/config_helper.rb', line 17 def defaults @defaults end |
Instance Method Details
#initialize(args = [], local_options = {}, config = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/tapioca/helpers/config_helper.rb', line 20 def initialize(args = [], = {}, config = {}) # Store current command command = config[:current_command] = config[:command_options] @command_name = T.let(command.name, String) @merged_options = T.let(nil, T.nilable(Thor::CoreExt::HashWithIndifferentAccess)) @defaults = T.let(Thor::CoreExt::HashWithIndifferentAccess.new, Thor::CoreExt::HashWithIndifferentAccess) # Filter command options unless we are handling the help command. # This is so that the defaults are printed filter_defaults() unless command_name == "help" super end |
#options ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/tapioca/helpers/config_helper.rb', line 36 def @merged_options ||= begin = super = () (defaults, , ) end end |