Module: Thor::Shell
- Defined in:
- lib/thor/shell.rb,
lib/thor/shell/basic.rb,
lib/thor/shell/color.rb
Defined Under Namespace
Constant Summary collapse
- SHELL_DELEGATED_METHODS =
[:ask, :yes?, :no?, :say, :say_status, :print_list, :print_table]
Instance Method Summary collapse
-
#initialize(args = [], options = {}, config = {}) ⇒ Object
Add shell to initialize config values.
-
#shell ⇒ Object
Holds the shell for the given Thor instance.
-
#shell=(shell) ⇒ Object
Sets the shell for this thor class.
Instance Method Details
#initialize(args = [], options = {}, config = {}) ⇒ Object
34 35 36 37 38 |
# File 'lib/thor/shell.rb', line 34 def initialize(args=[], ={}, config={}) super self.shell = config[:shell] self.shell.base ||= self if self.shell.respond_to?(:base) end |
#shell ⇒ Object
Holds the shell for the given Thor instance. If no shell is given, it gets a default shell from Thor::Base.shell.
43 44 45 |
# File 'lib/thor/shell.rb', line 43 def shell @shell ||= Thor::Base.shell.new end |
#shell=(shell) ⇒ Object
Sets the shell for this thor class.
49 50 51 |
# File 'lib/thor/shell.rb', line 49 def shell=(shell) @shell = shell end |