Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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