Skip to content
Newer
Older
100644 81 lines (63 sloc) 2.86 KB
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
1 require 'rake'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
2 require 'rake/rdoctask'
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
3
4 env = %(PKG_BUILD="#{ENV['PKG_BUILD']}") if ENV['PKG_BUILD']
5
03d2b6c @jeremy Forgot railties
jeremy authored
6 PROJECTS = %w(activesupport actionpack actionmailer activeresource activerecord railties)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
7
8 Dir["#{File.dirname(__FILE__)}/*/lib/*/version.rb"].each do |version_path|
9 require version_path
10 end
11
12 desc 'Run all tests by default'
13 task :default => :test
14
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
15 %w(test rdoc package release).each do |task_name|
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
16 desc "Run #{task_name} task for all projects"
17 task task_name do
18 PROJECTS.each do |project|
2bdac92 @jeremy Toplevel test task uses the same rake it was invoked with
jeremy authored
19 system %(cd #{project} && #{env} #{$0} #{task_name})
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
20 end
21 end
22 end
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
23
24
25 desc "Generate documentation for the Rails framework"
26 Rake::RDocTask.new do |rdoc|
27 rdoc.rdoc_dir = 'doc'
28 rdoc.title = "Rails Framework Documentation"
29
30 rdoc.options << '--line-numbers' << '--inline-source'
31 rdoc.options << '-A cattr_accessor=object'
32 rdoc.options << '--charset' << 'utf-8'
33
34 rdoc.template = "#{ENV['template']}.rb" if ENV['template']
35
36 rdoc.rdoc_files.include('railties/CHANGELOG')
37 rdoc.rdoc_files.include('railties/MIT-LICENSE')
38 rdoc.rdoc_files.include('railties/README')
39 rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
40
41 rdoc.rdoc_files.include('activerecord/README')
42 rdoc.rdoc_files.include('activerecord/CHANGELOG')
43 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
44 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
45
46 rdoc.rdoc_files.include('activeresource/README')
47 rdoc.rdoc_files.include('activeresource/CHANGELOG')
48 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
49 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
50
51 rdoc.rdoc_files.include('actionpack/README')
52 rdoc.rdoc_files.include('actionpack/CHANGELOG')
53 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
54 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
55 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
56
57 rdoc.rdoc_files.include('actionmailer/README')
58 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
59 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
60 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
61
62 rdoc.rdoc_files.include('activesupport/README')
63 rdoc.rdoc_files.include('activesupport/CHANGELOG')
64 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
65 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
66 end
67
68 # Enhance rdoc task to copy referenced images also
69 task :rdoc do
70 FileUtils.mkdir_p "doc/files/examples/"
71 FileUtils.copy "activerecord/examples/associations.png", "doc/files/examples/associations.png"
72 end
73
74 desc "Publish API docs for Rails as a whole and for each component"
75 task :pdoc => :rdoc do
76 Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc").upload
77 PROJECTS.each do |project|
78 system %(cd #{project} && #{env} #{$0} #{task_name})
79 end
80 end
Something went wrong with that request. Please try again.