Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (72 sloc) 3.362 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
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats 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
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
15 %w(test isolated_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
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
18 errors = []
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
19 PROJECTS.each do |project|
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
20 system(%(cd #{project} && #{env} #{$0} #{task_name})) || errors << project
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
21 end
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
22 fail("Errors in #{errors.join(', ')}") unless errors.empty?
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
23 end
24 end
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
25
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
26 task :install => :gem do
27 (PROJECTS - ["railties"]).each do |project|
28 system("gem install #{project}/pkg/#{project}-#{ActionPack::VERSION::STRING}.gem --no-ri --no-rdoc")
29 end
30 end
31
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
32
33 desc "Generate documentation for the Rails framework"
34 Rake::RDocTask.new do |rdoc|
a02d672 @jeremy Horo rdoc template
jeremy authored
35 rdoc.rdoc_dir = 'doc/rdoc'
36 rdoc.title = "Ruby on Rails Documentation"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
37
38 rdoc.options << '--line-numbers' << '--inline-source'
39 rdoc.options << '-A cattr_accessor=object'
40 rdoc.options << '--charset' << 'utf-8'
41
a02d672 @jeremy Horo rdoc template
jeremy authored
42 rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
43
44 rdoc.rdoc_files.include('railties/CHANGELOG')
45 rdoc.rdoc_files.include('railties/MIT-LICENSE')
46 rdoc.rdoc_files.include('railties/README')
5021dc6 @josevalim Vendorized Thor.
josevalim authored
47 rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,generators/*.rb}')
48 rdoc.rdoc_files.exclude('railties/lib/vendor/*')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
49
50 rdoc.rdoc_files.include('activerecord/README')
51 rdoc.rdoc_files.include('activerecord/CHANGELOG')
52 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
53 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
54
55 rdoc.rdoc_files.include('activeresource/README')
56 rdoc.rdoc_files.include('activeresource/CHANGELOG')
57 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
58 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
59
60 rdoc.rdoc_files.include('actionpack/README')
61 rdoc.rdoc_files.include('actionpack/CHANGELOG')
62 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
63 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
64 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
65
66 rdoc.rdoc_files.include('actionmailer/README')
67 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
68 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
69 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
70
71 rdoc.rdoc_files.include('activesupport/README')
72 rdoc.rdoc_files.include('activesupport/CHANGELOG')
73 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
74 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
75 end
76
77 # Enhance rdoc task to copy referenced images also
78 task :rdoc do
a02d672 @jeremy Horo rdoc template
jeremy authored
79 FileUtils.mkdir_p "doc/rdoc/files/examples/"
80 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
81 end
82
83 desc "Publish API docs for Rails as a whole and for each component"
84 task :pdoc => :rdoc do
4c96397 @jeremy Defer rake/contrib requires so we can use the stdlib rake instead of …
jeremy authored
85 require 'rake/contrib/sshpublisher'
a02d672 @jeremy Horo rdoc template
jeremy authored
86 Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc/rdoc").upload
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
87 PROJECTS.each do |project|
81025b5 @jeremy fix toplevel pdoc task
jeremy authored
88 system %(cd #{project} && #{env} #{$0} pdoc)
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
89 end
90 end
Something went wrong with that request. Please try again.