Class Index [+]

Quicksearch

Thor::Shell

Constants

SHELL_DELEGATED_METHODS

Public Class Methods

new(args=[], options={}, config={}) click to toggle source

Add shell to initialize config values.

Configuration

shell

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
    # File lib/bundler/vendor/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

Public Instance Methods

shell() click to toggle source

Holds the shell for the given Thor instance. If no shell is given, it gets a default shell from Thor::Base.shell.

    # File lib/bundler/vendor/thor/shell.rb, line 53
53:     def shell
54:       @shell ||= Thor::Base.shell.new
55:     end
shell=(shell) click to toggle source

Sets the shell for this thor class.

    # File lib/bundler/vendor/thor/shell.rb, line 58
58:     def shell=(shell)
59:       @shell = shell
60:     end
with_padding() click to toggle source

Yields the given block with padding.

    # File lib/bundler/vendor/thor/shell.rb, line 72
72:     def with_padding
73:       shell.padding += 1
74:       yield
75:     ensure
76:       shell.padding -= 1
77:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.