Add shell to initialize config values.
| shell | An instance of the shell to be used. |
class MyScript < Thor
argument :first, :type => :numeric
end
MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new
# File lib/thor/shell.rb, line 45
45: def initialize(args=[], options={}, config={})
46: super
47: self.shell = config[:shell]
48: self.shell.base ||= self if self.shell.respond_to?(:base)
49: end
Holds the shell for the given Thor instance. If no shell is given, it gets a default shell from Thor::Base.shell.
# File lib/thor/shell.rb, line 53
53: def shell
54: @shell ||= Thor::Base.shell.new
55: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.