123456789_123456789_123456789_123456789_123456789_

Module: Bundler::Thor::RakeCompat

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Rake::DSL, Rake::DSL
Defined in: lib/bundler/vendor/thor/lib/thor/rake_compat.rb

Overview

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

require 'bundler/vendor/thor/lib/thor/rake_compat'
require 'rspec/core/rake_task'

class Default < Bundler::Thor
  include Bundler::Thor::RakeCompat

  RSpec::Core::RakeTask.new(:spec) do |t|
    t.spec_opts = ['--options', './.rspec']
    t.spec_files = FileList['spec/**/*_spec.rb']
  end
end

Class Method Summary

Class Method Details

.included(base)

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/rake_compat.rb', line 27

def self.included(base)
  # Hack. Make rakefile point to invoker, so rdoc task is generated properly.
  rakefile = File.basename(caller[0].match(/(.*):\d+/)[1])
  Rake.application.instance_variable_set(:@rakefile, rakefile)
  rake_classes << base
end

.rake_classes

[ GitHub ]

  
# File 'lib/bundler/vendor/thor/lib/thor/rake_compat.rb', line 23

def self.rake_classes
  @rake_classes ||= []
end