Class: Object

### Home Classes Methods

### In Files

- lib/thor/rake_compat.rb

### Parent

BasicObject

### Methods

- #namespace
- #rake_namespace
- #task

### Class/Module Index

Quicksearch

- Thor
- Thor::Actions
- Thor::Actions::ClassMethods
- Thor::Base
- Thor::Base::ClassMethods
- Thor::Command
- Thor::DynamicCommand
- Thor::DynamicTask
- Thor::Error
- Thor::Group
- Thor::HiddenCommand
- Thor::HiddenTask
- Thor::InvocationError
- Thor::MalformattedArgumentError
- Thor::RakeCompat
- Thor::RequiredArgumentMissingError
- Thor::Shell
- Thor::Shell::Basic
- Thor::Shell::Color
- Thor::Shell::HTML
- Thor::Task
- Thor::UndefinedCommandError
- Thor::UndefinedTaskError
- Thor::UnknownArgumentError
- Thor::Util
- Object

No matching classes.

# Object

### Public Instance Methods

namespace(name) click to toggle source

    # File lib/thor/rake_compat.rb, line 60
    def namespace(name)
      if klass = Thor::RakeCompat.rake_classes.last
        const_name = Thor::Util.camel_case(name.to_s).to_sym
        klass.const_set(const_name, Class.new(Thor))
        new_klass = klass.const_get(const_name)
        Thor::RakeCompat.rake_classes << new_klass
      end

      super
      Thor::RakeCompat.rake_classes.pop
    end

Also aliased as: rake_namespace
rake_namespace(name) click to toggle source
Alias for: namespace
task(*) click to toggle source

    # File lib/thor/rake_compat.rb, line 40
    def task(*)
      task = super

      if klass = Thor::RakeCompat.rake_classes.last
        non_namespaced_name = task.name.split(':').last

        description = non_namespaced_name
        description << task.arg_names.map{ |n| n.to_s.upcase }.join(' ')
        description.strip!

        klass.desc description, Rake.application.last_description || non_namespaced_name
        Rake.application.last_description = nil
        klass.send :define_method, non_namespaced_name do |*args|
          Rake::Task[task.name.to_sym].invoke(*args)
        end
      end

      task
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.