Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (66 sloc) 3.097 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
9abab5b @jeremy Test railties earlier rather than having to wait through AR
jeremy authored
6 PROJECTS = %w(activesupport railties actionpack actionmailer activeresource activerecord)
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
e5af56a @jeremy Add global gem task
jeremy authored
15 %w(test rdoc pgem package release gem).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|
a02d672 @jeremy Horo rdoc template
jeremy authored
27 rdoc.rdoc_dir = 'doc/rdoc'
28 rdoc.title = "Ruby on Rails Documentation"
11361a9 @fxn restores railties/README as home page of the API
fxn authored
29 rdoc.main = "railties/README"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
30
31 rdoc.options << '--line-numbers' << '--inline-source'
32 rdoc.options << '-A cattr_accessor=object'
33 rdoc.options << '--charset' << 'utf-8'
2ed893b @fxn get railties/README back to the home page of the API
fxn authored
34 rdoc.options << '--main' << 'railties/README'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
35
a02d672 @jeremy Horo rdoc template
jeremy authored
36 rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
37
38 rdoc.rdoc_files.include('railties/CHANGELOG')
39 rdoc.rdoc_files.include('railties/MIT-LICENSE')
40 rdoc.rdoc_files.include('railties/README')
41 rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
42
43 rdoc.rdoc_files.include('activerecord/README')
44 rdoc.rdoc_files.include('activerecord/CHANGELOG')
45 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
46 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
47
48 rdoc.rdoc_files.include('activeresource/README')
49 rdoc.rdoc_files.include('activeresource/CHANGELOG')
50 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
51 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
52
53 rdoc.rdoc_files.include('actionpack/README')
54 rdoc.rdoc_files.include('actionpack/CHANGELOG')
55 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
56 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
57 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
58
59 rdoc.rdoc_files.include('actionmailer/README')
60 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
61 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
62 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
63
64 rdoc.rdoc_files.include('activesupport/README')
65 rdoc.rdoc_files.include('activesupport/CHANGELOG')
66 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
67 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
68 end
69
70 # Enhance rdoc task to copy referenced images also
71 task :rdoc do
a02d672 @jeremy Horo rdoc template
jeremy authored
72 FileUtils.mkdir_p "doc/rdoc/files/examples/"
73 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
74 end
75
76 desc "Publish API docs for Rails as a whole and for each component"
77 task :pdoc => :rdoc do
cc5d313 @jeremy Lazier Rakefile requires to avoid needing full rake gem on 1.9
jeremy authored
78 require 'rake/contrib/sshpublisher'
a02d672 @jeremy Horo rdoc template
jeremy authored
79 Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc/rdoc").upload
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
80 PROJECTS.each do |project|
81025b5 @jeremy fix toplevel pdoc task
jeremy authored
81 system %(cd #{project} && #{env} #{$0} pdoc)
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
82 end
83 end
Something went wrong with that request. Please try again.