Method: Thor::Shell#initialize

Defined in:
lib/thor/shell.rb

#initialize(args = [], options = {}, config = {}) ⇒ Object

Add shell to initialize config values.

Configuration

shell<Object>

An instance of the shell to be used.

Examples

class MyScript < Thor
  argument :first, :type => :numeric
end

MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new


34
35
36
37
38
# File 'lib/thor/shell.rb', line 34

def initialize(args=[], options={}, config={})
  super
  self.shell = config[:shell]
  self.shell.base ||= self if self.shell.respond_to?(:base)
end