Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 190 lines (160 sloc) 6.833 kb
05adf52 Akira Matsuda Ensure RDoc::Task exists even if 'rdoc/task' was not required
amatsuda authored
1 require 'rdoc/task'
827a0fe Xavier Noria use sdoc to generate the API
fxn authored
2 require 'sdoc'
dff0dfb Xavier Noria adds a publish_docs task to force stable docs generation and publishing ...
fxn authored
3 require 'net/http'
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
4
4ff8c59 Carl Lerche Update the main Rakefile to use the new release tasks
carllerche authored
5 $:.unshift File.expand_path('..', __FILE__)
6 require "tasks/release"
7
8 desc "Build gem files for all projects"
9 task :build => "all:build"
10
11 desc "Release all gems to gemcutter and create a tag"
c3dd123 Carl Lerche Small cleanup of the release task
carllerche authored
12 task :release => "all:release"
4ff8c59 Carl Lerche Update the main Rakefile to use the new release tasks
carllerche authored
13
f1637bf Prem Sichanugrist Remove Active Resource source files from the repository
sikachu authored
14 PROJECTS = %w(activesupport activemodel actionpack actionmailer activerecord railties)
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
15
16 desc 'Run all tests by default'
bbb3e5a Jeremy Kemper Unify test:isolated across components and run by default at toplevel
jeremy authored
17 task :default => %w(test test:isolated)
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
18
728ba20 Xavier Noria include the root README.rdoc as main page
fxn authored
19 %w(test test:isolated package gem).each do |task_name|
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
20 desc "Run #{task_name} task for all projects"
21 task task_name do
49afe81 Kerry Buckley Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
22 errors = []
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
23 PROJECTS.each do |project|
11db694 Bryan Helmkamp Remove cruft in the gem packaging and release code
brynary authored
24 system(%(cd #{project} && #{$0} #{task_name})) || errors << project
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
25 end
49afe81 Kerry Buckley Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
26 fail("Errors in #{errors.join(', ')}") unless errors.empty?
8922c5d Jeremy Kemper Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
27 end
28 end
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
29
a76af23 Jeremy Kemper rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
30 desc "Smoke-test all projects"
31 task :smoke do
32 (PROJECTS - %w(activerecord)).each do |project|
11db694 Bryan Helmkamp Remove cruft in the gem packaging and release code
brynary authored
33 system %(cd #{project} && #{$0} test:isolated)
a76af23 Jeremy Kemper rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
34 end
11db694 Bryan Helmkamp Remove cruft in the gem packaging and release code
brynary authored
35 system %(cd activerecord && #{$0} sqlite3:isolated_test)
a76af23 Jeremy Kemper rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
36 end
8ff310a Break up rails and railties:
Carlhuda authored
37
87a011d José Valim Make install appear on rake -T.
josevalim authored
38 desc "Install gems for all projects."
f3ed0de Yehuda Katz Create an install task that successfully installs all Rails gems
wycats authored
39 task :install => :gem do
c428fbd Yehuda Katz Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
40 version = File.read("RAILS_VERSION").strip
f3ed0de Yehuda Katz Create an install task that successfully installs all Rails gems
wycats authored
41 (PROJECTS - ["railties"]).each do |project|
8ff310a Break up rails and railties:
Carlhuda authored
42 puts "INSTALLING #{project}"
c428fbd Yehuda Katz Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
43 system("gem install #{project}/pkg/#{project}-#{version}.gem --no-ri --no-rdoc")
f3ed0de Yehuda Katz Create an install task that successfully installs all Rails gems
wycats authored
44 end
c428fbd Yehuda Katz Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 state...
wycats authored
45 system("gem install railties/pkg/railties-#{version}.gem --no-ri --no-rdoc")
46 system("gem install pkg/rails-#{version}.gem --no-ri --no-rdoc")
f3ed0de Yehuda Katz Create an install task that successfully installs all Rails gems
wycats authored
47 end
48
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
49 desc "Generate documentation for the Rails framework"
b50635a Aaron Patterson update Rakefiles for RDoc 2.5
tenderlove authored
50 RDoc::Task.new do |rdoc|
e68b7a0 Xavier Noria (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
51 RDOC_MAIN = 'RDOC_MAIN.rdoc'
52
caadef9 Xavier Noria backslash insertion for RDoc main page ignores code blocks, also adds co...
fxn authored
53 # This is a hack.
54 #
55 # Backslashes are needed to prevent RDoc from autolinking "Rails" to the
56 # documentation of the Rails module. On the other hand, as of this
57 # writing README.rdoc is displayed in the front page of the project in
58 # GitHub, where backslashes are shown and look weird.
59 #
60 # The temporary solution is to have a README.rdoc without backslashes for
61 # GitHub, and gsub it to generate the main page of the API.
62 #
ed4be0a Xavier Noria explains why links are gsub'ed, and changes the regexp delimiters
fxn authored
63 # Also, relative links in GitHub have to point to blobs, whereas in the API
64 # they need to point to files.
65 #
caadef9 Xavier Noria backslash insertion for RDoc main page ignores code blocks, also adds co...
fxn authored
66 # The idea for the future is to have totally different files, since the
67 # API is no longer a generic entry point to Rails and deserves a
68 # dedicated main page specifically thought as an API entry point.
e68b7a0 Xavier Noria (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
69 rdoc.before_running_rdoc do
70 rdoc_main = File.read('README.rdoc')
caadef9 Xavier Noria backslash insertion for RDoc main page ignores code blocks, also adds co...
fxn authored
71
72 # The ^(?=\S) assertion prevents code blocks from being processed,
73 # since no autolinking happens there and RDoc displays the backslash
74 # otherwise.
75 rdoc_main.gsub!(/^(?=\S).*?\b(?=Rails)\b/) { "#$&\\" }
c3bd6bb Vijay Dev Fixes readme links better - earlier links broke when the current page is...
vijaydev authored
76 rdoc_main.gsub!(%r{link:/rails/rails/blob/master/(\w+)/README\.rdoc}, "link:files/\\1/README_rdoc.html")
caadef9 Xavier Noria backslash insertion for RDoc main page ignores code blocks, also adds co...
fxn authored
77
c195aed Organize README
Vinny Diehl authored
78 # Remove Travis and Gemnasium status images from API pages. Only the GitHub
79 # README page gets these images. Travis's HTTPS build image is used to
80 # avoid GitHub caching: http://about.travis-ci.org/docs/user/status-images
81 rdoc_main.gsub!(/^== Code Status(\n(?!==).*)*/, '')
71232f5 Anand Travis status image added to GitHub README, excluding API pages.
luckydev authored
82
e68b7a0 Xavier Noria (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
83 File.open(RDOC_MAIN, 'w') do |f|
84 f.write(rdoc_main)
85 end
86
87 rdoc.rdoc_files.include(RDOC_MAIN)
88 end
89
a02d672 Jeremy Kemper Horo rdoc template
jeremy authored
90 rdoc.rdoc_dir = 'doc/rdoc'
91 rdoc.title = "Ruby on Rails Documentation"
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
92
827a0fe Xavier Noria use sdoc to generate the API
fxn authored
93 rdoc.options << '-f' << 'sdoc'
94 rdoc.options << '-T' << 'rails'
2ddfbbc Toshinori Kajihara Use -e option instead of -c option (rake rdoc task).
kennyj authored
95 rdoc.options << '-e' << 'UTF-8'
5aa86f7 Xavier Noria let SDoc add a link to the source code in GitHub for each method
fxn authored
96 rdoc.options << '-g' # SDoc flag, link methods to GitHub
e68b7a0 Xavier Noria (temporary hack) generate a main file for RDoc escaping "Rails"
fxn authored
97 rdoc.options << '-m' << RDOC_MAIN
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
98
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
99 rdoc.rdoc_files.include('railties/CHANGELOG.md')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
100 rdoc.rdoc_files.include('railties/MIT-LICENSE')
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
101 rdoc.rdoc_files.include('railties/README.rdoc')
d39ec81 Andrew White Make Railties RDoc task work again [#4291 state:resolved]
pixeltrix authored
102 rdoc.rdoc_files.include('railties/lib/**/*.rb')
de757af Xavier Noria revises the pattern that excludes generator templates in API generation
fxn authored
103 rdoc.rdoc_files.exclude('railties/lib/rails/generators/**/templates/**/*.rb')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
104
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
105 rdoc.rdoc_files.include('activerecord/README.rdoc')
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
106 rdoc.rdoc_files.include('activerecord/CHANGELOG.md')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
107 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
108 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
109
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
110 rdoc.rdoc_files.include('actionpack/README.rdoc')
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
111 rdoc.rdoc_files.include('actionpack/CHANGELOG.md')
aed698a Xavier Noria adds Abstract Controller to the API
fxn authored
112 rdoc.rdoc_files.include('actionpack/lib/abstract_controller/**/*.rb')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
113 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
26bc5c5 Andrew White Add ActionDispatch to RDoc task [#4287 state:resolved]
pixeltrix authored
114 rdoc.rdoc_files.include('actionpack/lib/action_dispatch/**/*.rb')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
115 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
116 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
117
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
118 rdoc.rdoc_files.include('actionmailer/README.rdoc')
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
119 rdoc.rdoc_files.include('actionmailer/CHANGELOG.md')
f7c6da2 Francesco Rodríguez fix rdoc task for Action Mailer documentation
frodsan authored
120 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/**/*.rb')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
121 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
122
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
123 rdoc.rdoc_files.include('activesupport/README.rdoc')
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
124 rdoc.rdoc_files.include('activesupport/CHANGELOG.md')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
125 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
126 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
9fd9e5d Xavier Noria fixes doc generation
fxn authored
127
508fba9 José Valim Add .rdoc extension to README files.
josevalim authored
128 rdoc.rdoc_files.include('activemodel/README.rdoc')
8e56866 Rahul P. Chaudhari Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
rahul100885 authored
129 rdoc.rdoc_files.include('activemodel/CHANGELOG.md')
9fd9e5d Xavier Noria fixes doc generation
fxn authored
130 rdoc.rdoc_files.include('activemodel/lib/active_model/**/*.rb')
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
131 end
132
133 # Enhance rdoc task to copy referenced images also
134 task :rdoc do
a02d672 Jeremy Kemper Horo rdoc template
jeremy authored
135 FileUtils.mkdir_p "doc/rdoc/files/examples/"
136 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 Jeremy Kemper Add toplevel rdoc and pdoc tasks
jeremy authored
137 end
138
b861942 Jeremy Kemper Update CHANGELOGs for 3.0 release and upcoming 3.1
jeremy authored
139 desc 'Bump all versions to match version.rb'
b1769fe Bryan Helmkamp Add `rake update_versions` task at root for quickly updating all compone...
brynary authored
140 task :update_versions do
deb00bc Bryan Helmkamp Read Rails version from a file instead of modifying the load path and do...
brynary authored
141 require File.dirname(__FILE__) + "/version"
142
143 File.open("RAILS_VERSION", "w") do |f|
144 f.write Rails::VERSION::STRING + "\n"
145 end
146
b1769fe Bryan Helmkamp Add `rake update_versions` task at root for quickly updating all compone...
brynary authored
147 constants = {
148 "activesupport" => "ActiveSupport",
149 "activemodel" => "ActiveModel",
150 "actionpack" => "ActionPack",
151 "actionmailer" => "ActionMailer",
152 "activerecord" => "ActiveRecord",
153 "railties" => "Rails"
154 }
155
156 version_file = File.read("version.rb")
157
158 PROJECTS.each do |project|
159 Dir["#{project}/lib/*/version.rb"].each do |file|
160 File.open(file, "w") do |f|
161 f.write version_file.gsub(/Rails/, constants[project])
162 end
163 end
164 end
165 end
dff0dfb Xavier Noria adds a publish_docs task to force stable docs generation and publishing ...
fxn authored
166
167 #
168 # We have a webhook configured in Github that gets invoked after pushes.
169 # This hook triggers the following tasks:
170 #
171 # * updates the local checkout
172 # * updates Rails Contributors
173 # * generates and publishes edge docs
174 # * if there's a new stable tag, generates and publishes stable docs
175 #
176 # Everything is automated and you do NOT need to run this task normally.
177 #
646e520 Santiago Pastorino Typo fixed
spastorino authored
178 # We publish a new version by tagging, and pushing a tag does not trigger
dff0dfb Xavier Noria adds a publish_docs task to force stable docs generation and publishing ...
fxn authored
179 # that webhook. Stable docs would be updated by any subsequent regular
180 # push, but if you want that to happen right away just run this.
181 #
182 desc 'Publishes docs, run this AFTER a new stable tag has been pushed'
183 task :publish_docs do
c2aadf8 Xavier Noria updates the host and port of publish_docs, and changes the release instr...
fxn authored
184 Net::HTTP.new('api.rubyonrails.org', 8080).start do |http|
dff0dfb Xavier Noria adds a publish_docs task to force stable docs generation and publishing ...
fxn authored
185 request = Net::HTTP::Post.new('/rails-master-hook')
186 response = http.request(request)
187 puts response.body
188 end
189 end
Something went wrong with that request. Please try again.