aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r--railties/lib/rails/tasks/documentation.rake54
-rw-r--r--railties/lib/rails/tasks/middleware.rake2
-rw-r--r--railties/lib/rails/tasks/routes.rake1
3 files changed, 33 insertions, 24 deletions
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake
index 65d0d476ba..3f49a9a720 100644
--- a/railties/lib/rails/tasks/documentation.rake
+++ b/railties/lib/rails/tasks/documentation.rake
@@ -11,35 +11,43 @@ namespace :doc do
rdoc.rdoc_files.include('lib/**/*.rb')
}
- desc "Generate documentation for the Rails framework"
+ desc 'Generate documentation for the Rails framework. Specify path with PATH="/path/to/rails"'
Rake::RDocTask.new("rails") { |rdoc|
+ path = ENV['RAILS_PATH'] || 'vendor/gems/gems'
+ version = '-3.0.pre' unless ENV['RAILS_PATH']
rdoc.rdoc_dir = 'doc/api'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.title = "Rails Framework Documentation"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('vendor/rails/railties/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/railties/MIT-LICENSE')
- rdoc.rdoc_files.include('vendor/rails/railties/README')
- rdoc.rdoc_files.include('vendor/rails/railties/lib/{*.rb,commands/*.rb,generators/*.rb}')
- rdoc.rdoc_files.include('vendor/rails/activerecord/README')
- rdoc.rdoc_files.include('vendor/rails/activerecord/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/activerecord/lib/active_record/**/*.rb')
- rdoc.rdoc_files.exclude('vendor/rails/activerecord/lib/active_record/vendor/*')
- rdoc.rdoc_files.include('vendor/rails/activeresource/README')
- rdoc.rdoc_files.include('vendor/rails/activeresource/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/activeresource/lib/active_resource.rb')
- rdoc.rdoc_files.include('vendor/rails/activeresource/lib/active_resource/*')
- rdoc.rdoc_files.include('vendor/rails/actionpack/README')
- rdoc.rdoc_files.include('vendor/rails/actionpack/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_controller/**/*.rb')
- rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_view/**/*.rb')
- rdoc.rdoc_files.include('vendor/rails/actionmailer/README')
- rdoc.rdoc_files.include('vendor/rails/actionmailer/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/actionmailer/lib/action_mailer/base.rb')
- rdoc.rdoc_files.include('vendor/rails/activesupport/README')
- rdoc.rdoc_files.include('vendor/rails/activesupport/CHANGELOG')
- rdoc.rdoc_files.include('vendor/rails/activesupport/lib/active_support/**/*.rb')
+
+ %w(README CHANGELOG lib/action_mailer/base.rb).each do |file|
+ rdoc.rdoc_files.include("#{path}/actionmailer#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG lib/action_controller/**/*.rb lib/action_view/**/*.rb).each do |file|
+ rdoc.rdoc_files.include("#{path}/actionpack#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG lib/active_model/**/*.rb).each do |file|
+ rdoc.rdoc_files.include("#{path}/activemodel#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG lib/active_record/**/*.rb).each do |file|
+ rdoc.rdoc_files.include("#{path}/activerecord#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG lib/active_resource.rb lib/active_resource/*).each do |file|
+ rdoc.rdoc_files.include("#{path}/activeresource#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG lib/active_support/**/*.rb).each do |file|
+ rdoc.rdoc_files.include("#{path}/activesupport#{version}/#{file}")
+ end
+
+ %w(README CHANGELOG MIT-LICENSE lib/{*.rb,commands/*.rb,generators/*.rb}).each do |file|
+ rdoc.rdoc_files.include("#{path}/railties#{version}/#{file}")
+ end
}
plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
diff --git a/railties/lib/rails/tasks/middleware.rake b/railties/lib/rails/tasks/middleware.rake
index 5a5bd7a7e9..c3aaddb153 100644
--- a/railties/lib/rails/tasks/middleware.rake
+++ b/railties/lib/rails/tasks/middleware.rake
@@ -3,5 +3,5 @@ task :middleware => :environment do
Rails.configuration.middleware.active.each do |middleware|
puts "use #{middleware.inspect}"
end
- puts "run #{Rails.application.class.name}"
+ puts "run #{Rails::Application.class.name}"
end
diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake
index 2395d73b2f..e8da72db4d 100644
--- a/railties/lib/rails/tasks/routes.rake
+++ b/railties/lib/rails/tasks/routes.rake
@@ -1,5 +1,6 @@
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
task :routes => :environment do
+ Rails::Application.reload_routes!
all_routes = ENV['CONTROLLER'] ? ActionController::Routing::Routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : ActionController::Routing::Routes.routes
routes = all_routes.collect do |route|
name = ActionController::Routing::Routes.named_routes.routes.index(route).to_s