Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 155 lines (128 sloc) 5.216 kb
2944a79 @fxn bump required RDoc to >= 2.5.9, and replace the 2.2 horo.rb with Aaron's...
fxn authored
1 gem 'rdoc', '>= 2.5.9'
07c6b7a @fxn migrates the Jamis template to RDoc 2.x, the root Rakefile requires RDoc...
fxn authored
2 require 'rdoc'
3
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
4 require 'rake'
b50635a @tenderlove update Rakefiles for RDoc 2.5
tenderlove authored
5 require 'rdoc/task'
8ff310a Break up rails and railties:
Carlhuda authored
6 require 'rake/gempackagetask'
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
7
8ff310a Break up rails and railties:
Carlhuda authored
8 PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
9
10 desc 'Run all tests by default'
bbb3e5a @jeremy Unify test:isolated across components and run by default at toplevel
jeremy authored
11 task :default => %w(test test:isolated)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
12
728ba20 @fxn include the root README.rdoc as main page
fxn authored
13 %w(test test:isolated package gem).each do |task_name|
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
14 desc "Run #{task_name} task for all projects"
15 task task_name do
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
16 errors = []
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
17 PROJECTS.each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
18 system(%(cd #{project} && #{$0} #{task_name})) || errors << project
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
19 end
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
20 fail("Errors in #{errors.join(', ')}") unless errors.empty?
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
21 end
22 end
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
23
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
24 desc "Smoke-test all projects"
25 task :smoke do
26 (PROJECTS - %w(activerecord)).each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
27 system %(cd #{project} && #{$0} test:isolated)
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
28 end
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
29 system %(cd activerecord && #{$0} sqlite3:isolated_test)
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
30 end
8ff310a Break up rails and railties:
Carlhuda authored
31
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
32 spec = eval(File.read('rails.gemspec'))
8ff310a Break up rails and railties:
Carlhuda authored
33 Rake::GemPackageTask.new(spec) do |pkg|
34 pkg.gem_spec = spec
35 end
36
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
37 desc "Release all gems to gemcutter. Package rails, package & push components, then push rails"
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
38 task :release => :release_projects do
39 require 'rake/gemcutter'
40 Rake::Gemcutter::Tasks.new(spec).define
41 Rake::Task['gem:push'].invoke
42 end
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
43
44 desc "Release all components to gemcutter."
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
45 task :release_projects => :package do
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
46 errors = []
47 PROJECTS.each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
48 system(%(cd #{project} && #{$0} release)) || errors << project
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
49 end
50 fail("Errors in #{errors.join(', ')}") unless errors.empty?
51 end
52
87a011d @josevalim Make install appear on rake -T.
authored
53 desc "Install gems for all projects."
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
54 task :install => :gem do
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
55 version = File.read("RAILS_VERSION").strip
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
56 (PROJECTS - ["railties"]).each do |project|
8ff310a Break up rails and railties:
Carlhuda authored
57 puts "INSTALLING #{project}"
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
58 system("gem install #{project}/pkg/#{project}-#{version}.gem --no-ri --no-rdoc")
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
59 end
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
60 system("gem install railties/pkg/railties-#{version}.gem --no-ri --no-rdoc")
61 system("gem install pkg/rails-#{version}.gem --no-ri --no-rdoc")
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
62 end
63
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
64 desc "Generate documentation for the Rails framework"
b50635a @tenderlove update Rakefiles for RDoc 2.5
tenderlove authored
65 RDoc::Task.new do |rdoc|
a02d672 @jeremy Horo rdoc template
jeremy authored
66 rdoc.rdoc_dir = 'doc/rdoc'
67 rdoc.title = "Ruby on Rails Documentation"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
68
b50635a @tenderlove update Rakefiles for RDoc 2.5
tenderlove authored
69 rdoc.options << '-f' << 'horo'
728ba20 @fxn include the root README.rdoc as main page
fxn authored
70 rdoc.options << '-c' << 'utf-8'
71 rdoc.options << '-m' << 'README.rdoc'
72
73 rdoc.rdoc_files.include('README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
74
75 rdoc.rdoc_files.include('railties/CHANGELOG')
76 rdoc.rdoc_files.include('railties/MIT-LICENSE')
508fba9 @josevalim Add .rdoc extension to README files.
authored
77 rdoc.rdoc_files.include('railties/README.rdoc')
d39ec81 @pixeltrix Make Railties RDoc task work again [#4291 state:resolved]
pixeltrix authored
78 rdoc.rdoc_files.include('railties/lib/**/*.rb')
79 rdoc.rdoc_files.exclude('railties/lib/rails/generators/**/templates/*')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
80
508fba9 @josevalim Add .rdoc extension to README files.
authored
81 rdoc.rdoc_files.include('activerecord/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
82 rdoc.rdoc_files.include('activerecord/CHANGELOG')
83 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
84 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
85
508fba9 @josevalim Add .rdoc extension to README files.
authored
86 rdoc.rdoc_files.include('activeresource/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
87 rdoc.rdoc_files.include('activeresource/CHANGELOG')
88 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
89 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
90
508fba9 @josevalim Add .rdoc extension to README files.
authored
91 rdoc.rdoc_files.include('actionpack/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
92 rdoc.rdoc_files.include('actionpack/CHANGELOG')
93 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
26bc5c5 @pixeltrix Add ActionDispatch to RDoc task [#4287 state:resolved]
pixeltrix authored
94 rdoc.rdoc_files.include('actionpack/lib/action_dispatch/**/*.rb')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
95 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
96 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
97
508fba9 @josevalim Add .rdoc extension to README files.
authored
98 rdoc.rdoc_files.include('actionmailer/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
99 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
100 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
101 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
102
508fba9 @josevalim Add .rdoc extension to README files.
authored
103 rdoc.rdoc_files.include('activesupport/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
104 rdoc.rdoc_files.include('activesupport/CHANGELOG')
105 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
106 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
9fd9e5d @fxn fixes doc generation
fxn authored
107
508fba9 @josevalim Add .rdoc extension to README files.
authored
108 rdoc.rdoc_files.include('activemodel/README.rdoc')
9fd9e5d @fxn fixes doc generation
fxn authored
109 rdoc.rdoc_files.include('activemodel/CHANGELOG')
110 rdoc.rdoc_files.include('activemodel/lib/active_model/**/*.rb')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
111 end
112
113 # Enhance rdoc task to copy referenced images also
114 task :rdoc do
a02d672 @jeremy Horo rdoc template
jeremy authored
115 FileUtils.mkdir_p "doc/rdoc/files/examples/"
116 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
117 end
118
119 desc "Publish API docs for Rails as a whole and for each component"
120 task :pdoc => :rdoc do
4c96397 @jeremy Defer rake/contrib requires so we can use the stdlib rake instead of the...
jeremy authored
121 require 'rake/contrib/sshpublisher'
2aa4e5f @fxn pdoc tasks publishe APIs in api.rubyonrails.org
fxn authored
122 Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/api", "doc/rdoc").upload
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
123 PROJECTS.each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
124 system %(cd #{project} && #{$0} pdoc)
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
125 end
126 end
b1769fe @brynary Add `rake update_versions` task at root for quickly updating all compone...
brynary authored
127
128 task :update_versions do
deb00bc @brynary Read Rails version from a file instead of modifying the load path and do...
brynary authored
129 require File.dirname(__FILE__) + "/version"
130
131 File.open("RAILS_VERSION", "w") do |f|
132 f.write Rails::VERSION::STRING + "\n"
133 end
134
b1769fe @brynary Add `rake update_versions` task at root for quickly updating all compone...
brynary authored
135 constants = {
136 "activesupport" => "ActiveSupport",
137 "activemodel" => "ActiveModel",
138 "actionpack" => "ActionPack",
139 "actionmailer" => "ActionMailer",
140 "activeresource" => "ActiveResource",
141 "activerecord" => "ActiveRecord",
142 "railties" => "Rails"
143 }
144
145 version_file = File.read("version.rb")
146
147 PROJECTS.each do |project|
148 Dir["#{project}/lib/*/version.rb"].each do |file|
149 File.open(file, "w") do |f|
150 f.write version_file.gsub(/Rails/, constants[project])
151 end
152 end
153 end
154 end
Something went wrong with that request. Please try again.