Thor::RakeCompat

Adds a compatibility layer to your Thor classes which allows you to use rake package tasks. For example, to use rspec rake tasks, one can do:

  require 'thor/rake_compat'

  class Default < Thor
    include Thor::RakeCompat

    Spec::Rake::SpecTask.new(:spec) do |t|
      t.spec_opts = ['--options', "spec/spec.opts"]
      t.spec_files = FileList['spec/**/*_spec.rb']
    end
  end

Public Class Methods

included(base) click to toggle source

(Not documented)

    # File lib/thor/rake_compat.rb, line 23
23:     def self.included(base)
24:       # Hack. Make rakefile point to invoker, so rdoc task is generated properly.
25:       Rake.application.instance_variable_set(:@rakefile, caller[0].match(/(.*):\d+/)[1])
26:       self.rake_classes << base
27:     end
rake_classes() click to toggle source

(Not documented)

    # File lib/thor/rake_compat.rb, line 19
19:     def self.rake_classes
20:       @rake_classes ||= []
21:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.