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.013 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"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
29
30 rdoc.options << '--line-numbers' << '--inline-source'
31 rdoc.options << '-A cattr_accessor=object'
32 rdoc.options << '--charset' << 'utf-8'
33
a02d672 @jeremy Horo rdoc template
jeremy authored
34 rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
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
a02d672 @jeremy Horo rdoc template
jeremy authored
70 FileUtils.mkdir_p "doc/rdoc/files/examples/"
71 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
72 end
73
74 desc "Publish API docs for Rails as a whole and for each component"
75 task :pdoc => :rdoc do
cc5d313 @jeremy Lazier Rakefile requires to avoid needing full rake gem on 1.9
jeremy authored
76 require 'rake/contrib/sshpublisher'
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.