Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4245: symlinked_plugins.patch

File symlinked_plugins.patch, 2.0 kB (added by brandon, 2 years ago)

pick up generators and rake tasks in symlinked plugins

  • railties/lib/rails_generator/lookup.rb

    old new  
    100100          if defined? ::RAILS_ROOT 
    101101            sources << PathSource.new(:lib, "#{::RAILS_ROOT}/lib/generators") 
    102102            sources << PathSource.new(:vendor, "#{::RAILS_ROOT}/vendor/generators") 
    103             sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/**/generators") 
     103            sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/*/**/generators") 
    104104          end 
    105105          sources << PathSource.new(:user, "#{Dir.user_home}/.rails/generators") 
    106106          sources << GemSource.new if Object.const_defined?(:Gem) 
  • railties/lib/tasks/rails.rb

    old new  
    55 
    66# Load any custom rakefile extensions 
    77Dir["#{RAILS_ROOT}/lib/tasks/**/*.rake"].sort.each { |ext| load ext } 
    8 Dir["#{RAILS_ROOT}/vendor/plugins/**/tasks/**/*.rake"].sort.each { |ext| load ext } 
     8Dir["#{RAILS_ROOT}/vendor/plugins/*/**/tasks/**/*.rake"].sort.each { |ext| load ext } 
  • railties/lib/tasks/testing.rake

    old new  
    108108    if ENV['PLUGIN'] 
    109109      t.pattern = "vendor/plugins/#{ENV['PLUGIN']}/test/**/*_test.rb" 
    110110    else 
    111       t.pattern = 'vendor/plugins/**/test/**/*_test.rb' 
     111      t.pattern = 'vendor/plugins/*/**/test/**/*_test.rb' 
    112112    end 
    113113 
    114114    t.verbose = true 
    115115  end 
    116   Rake::Task['test:plugins'].comment = "Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)" 
     116  Rake::Task['test:plugins'].comment = "Run the plugin tests in vendor/plugins/*/**/test (or specify with PLUGIN=name)" 
    117117end