Module: Tapioca::ConfigHelper
- Included in:
- Cli
- Defined in:
- lib/tapioca/helpers/config_helper.rb
Overview
@requires_ancestor: Thor
Defined Under Namespace
Classes: ConfigError, ConfigErrorMessagePart
Instance Attribute Summary collapse
-
#command_name ⇒ Object
readonly
: String.
-
#defaults ⇒ Object
readonly
: Thor::CoreExt::HashWithIndifferentAccess.
Instance Method Summary collapse
-
#initialize(args = [], local_options = {}, config = {}) ⇒ Object
: (?untyped args, ?untyped local_options, ?untyped config) -> void.
-
#options ⇒ Object
: -> Thor::CoreExt::HashWithIndifferentAccess.
Instance Attribute Details
#command_name ⇒ Object (readonly)
: String
8 9 10 |
# File 'lib/tapioca/helpers/config_helper.rb', line 8 def command_name @command_name end |
#defaults ⇒ Object (readonly)
: Thor::CoreExt::HashWithIndifferentAccess
11 12 13 |
# File 'lib/tapioca/helpers/config_helper.rb', line 11 def defaults @defaults end |
Instance Method Details
#initialize(args = [], local_options = {}, config = {}) ⇒ Object
: (?untyped args, ?untyped local_options, ?untyped config) -> void
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tapioca/helpers/config_helper.rb', line 14 def initialize(args = [], = {}, config = {}) # Store current command command = config[:current_command] = config[:command_options] @command_name = command.name #: String @merged_options = nil #: Thor::CoreExt::HashWithIndifferentAccess? @defaults = 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
: -> Thor::CoreExt::HashWithIndifferentAccess
30 31 32 33 34 35 36 37 |
# File 'lib/tapioca/helpers/config_helper.rb', line 30 def @merged_options ||= begin = super = () (defaults, , ) end end |