Module: Thor::Actions::ClassMethods

### Home Classes Methods

### In Files

- lib/thor/actions.rb

### Methods

- #add_runtime_options!
- #source_paths
- #source_paths_for_search
- #source_root

### Class/Module Index

Quicksearch

- Thor
- Thor::Actions
- Thor::Actions::ClassMethods
- Thor::AmbiguousCommandError
- Thor::Base
- Thor::Base::ClassMethods
- Thor::Command
- Thor::DynamicCommand
- Thor::Error
- Thor::Group
- Thor::HiddenCommand
- Thor::Invocation
- Thor::Invocation::ClassMethods
- Thor::InvocationError
- Thor::LineEditor
- Thor::LineEditor::Basic
- Thor::LineEditor::Readline
- Thor::LineEditor::Readline::PathCompletion
- Thor::MalformattedArgumentError
- Thor::RakeCompat
- Thor::RequiredArgumentMissingError
- Thor::Shell
- Thor::Shell::Basic
- Thor::Shell::Color
- Thor::Shell::HTML
- Thor::UndefinedCommandError
- Thor::UnknownArgumentError
- Thor::Util
- Object

No matching classes.

# Thor::Actions::ClassMethods

### Public Instance Methods

add_runtime_options!() click to toggle source

Add runtime options that help actions execution.

    # File lib/thor/actions.rb, line 50
    def add_runtime_options!
      class_option :force, :type => :boolean, :aliases => "-f", :group => :runtime,
                           :desc => "Overwrite files that already exist"

      class_option :pretend, :type => :boolean, :aliases => "-p", :group => :runtime,
                             :desc => "Run but do not make any changes"

      class_option :quiet, :type => :boolean, :aliases => "-q", :group => :runtime,
                           :desc => "Suppress status output"

      class_option :skip, :type => :boolean, :aliases => "-s", :group => :runtime,
                          :desc => "Skip files that already exist"
    end

source_paths() click to toggle source

Hold source paths for one Thor instance. source_paths_for_search is the method responsible to gather source_paths from this current class, inherited paths and the source root.

    # File lib/thor/actions.rb, line 24
    def source_paths
      @_source_paths ||= []
    end

source_paths_for_search() click to toggle source

Returns the source paths in the following order:

    1) This class source paths
    2) Source root
    3) Parents source paths

    # File lib/thor/actions.rb, line 40
    def source_paths_for_search
      paths = []
      paths += source_paths
      paths << source_root if source_root
      paths += from_superclass(:source_paths, [])
      paths
    end

source_root(path = nil) click to toggle source

Stores and return the source root for this class

    # File lib/thor/actions.rb, line 29
    def source_root(path = nil)
      @_source_root = path if path
      @_source_root ||= nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.