Namespace

Thor::Base

Attributes

options[RW]

(Not documented)

Public Class Methods

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

It receives arguments in an Array and two hashes, one for options and other for configuration.

Notice that it does not check if all required arguments were supplied. It should be done by the parser.

Parameters

args:An array of objects. The objects are applied to their respective accessors declared with argument.
options:An options hash that will be available as self.options. The hash given is converted to a hash with indifferent access, magic predicates (options.skip?) and then frozen.
config:Configuration for this Thor class.
    # File lib/thor/base.rb, line 37
37:     def initialize(args=[], options={}, config={})
38:       Thor::Arguments.parse(self.class.arguments, args).each do |key, value|
39:         send("#{key}=", value)
40:       end
41: 
42:       parse_options = self.class.class_options
43: 
44:       if options.is_a?(Array)
45:         task_options  = config.delete(:task_options) # hook for start
46:         parse_options = parse_options.merge(task_options) if task_options
47:         array_options, hash_options = options, {}
48:       else
49:         array_options, hash_options = [], options
50:       end
51: 
52:       options = Thor::Options.parse(parse_options, array_options)
53:       self.options = Thor::CoreExt::HashWithIndifferentAccess.new(options).merge!(hash_options)
54:       self.options.freeze
55:     end
shell() click to toggle source

Returns the shell used in all Thor classes. Default to color one.

   # File lib/thor/shell.rb, line 7
7:     def self.shell
8:       @shell ||= Thor::Shell::Color
9:     end
shell=(klass) click to toggle source

Sets the shell used in all Thor classes.

    # File lib/thor/shell.rb, line 13
13:     def self.shell=(klass)
14:       @shell = klass
15:     end
subclass_files() click to toggle source

Returns the files where the subclasses are kept.

Returns

Hash[path => Class]

    # File lib/thor/base.rb, line 78
78:       def subclass_files
79:         @subclass_files ||= Hash.new{ |h,k| h[k] = [] }
80:       end
subclasses() click to toggle source

Returns the classes that inherits from Thor or Thor::Group.

Returns

Array[Class]

    # File lib/thor/base.rb, line 69
69:       def subclasses
70:         @subclasses ||= []
71:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.