Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 162 lines (133 sloc) 5.476 kB
82eff0f @spastorino Bump up rdoc to 2.5.10
spastorino authored
1 gem 'rdoc', '>= 2.5.10'
07c6b7a @fxn migrates the Jamis template to RDoc 2.x, the root Rakefile requires R…
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'
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
6
2bf085f @carllerche Update the main Rakefile to use the new release tasks
carllerche authored
7 $:.unshift File.expand_path('..', __FILE__)
8 require "tasks/release"
9
10 desc "Build gem files for all projects"
11 task :build => "all:build"
12
13 desc "Release all gems to gemcutter and create a tag"
1e37653 @carllerche Small cleanup of the release task
carllerche authored
14 task :release => "all:release"
2bf085f @carllerche Update the main Rakefile to use the new release tasks
carllerche authored
15
5aec933 @fxn quick hack: hijacks the predicate RDoc::Parser.binary? so that it doe…
fxn authored
16 # RDoc skips some files in the Rails tree due to its binary? predicate. This is a quick
17 # hack for edge docs, until we decide which is the correct way to address this issue.
18 # If not fixed in RDoc itself, via an option or something, we should probably move this
19 # to railties and use it also in doc:rails.
20 def hijack_rdoc!
21 require "rdoc/parser"
22 class << RDoc::Parser
23 def binary?(file)
24 s = File.read(file, 1024) or return false
25
26 if s[0, 2] == Marshal.dump('')[0, 2] then
27 true
78c7705 @fxn undoes one of the modifications to RDoc::Parser.binary?
fxn authored
28 elsif file =~ /erb\.rb$/ then
5aec933 @fxn quick hack: hijacks the predicate RDoc::Parser.binary? so that it doe…
fxn authored
29 false
30 elsif s.index("\x00") then # ORIGINAL is s.scan(/<%|%>/).length >= 4 || s.index("\x00")
31 true
32 elsif 0.respond_to? :fdiv then
33 s.count("^ -~\t\r\n").fdiv(s.size) > 0.3
34 else # HACK 1.8.6
35 (s.count("^ -~\t\r\n").to_f / s.size) > 0.3
36 end
37 end
38 end
39 end
40
8ff310a Break up rails and railties:
Carlhuda authored
41 PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
42
43 desc 'Run all tests by default'
bbb3e5a @jeremy Unify test:isolated across components and run by default at toplevel
jeremy authored
44 task :default => %w(test test:isolated)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
45
728ba20 @fxn include the root README.rdoc as main page
fxn authored
46 %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
47 desc "Run #{task_name} task for all projects"
48 task task_name do
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
49 errors = []
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
50 PROJECTS.each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
51 system(%(cd #{project} && #{$0} #{task_name})) || errors << project
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
52 end
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
53 fail("Errors in #{errors.join(', ')}") unless errors.empty?
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
54 end
55 end
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
56
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
57 desc "Smoke-test all projects"
58 task :smoke do
59 (PROJECTS - %w(activerecord)).each do |project|
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
60 system %(cd #{project} && #{$0} test:isolated)
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
61 end
11db694 @brynary Remove cruft in the gem packaging and release code
brynary authored
62 system %(cd activerecord && #{$0} sqlite3:isolated_test)
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
63 end
8ff310a Break up rails and railties:
Carlhuda authored
64
87a011d @josevalim Make install appear on rake -T.
josevalim authored
65 desc "Install gems for all projects."
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
66 task :install => :gem do
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 st…
wycats authored
67 version = File.read("RAILS_VERSION").strip
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
68 (PROJECTS - ["railties"]).each do |project|
8ff310a Break up rails and railties:
Carlhuda authored
69 puts "INSTALLING #{project}"
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 st…
wycats authored
70 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
71 end
c428fbd @wycats Use the new RAILS_VERSION in rake install (ht: ZhangJinzhu) [#4116 st…
wycats authored
72 system("gem install railties/pkg/railties-#{version}.gem --no-ri --no-rdoc")
73 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
74 end
75
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
76 desc "Generate documentation for the Rails framework"
b50635a @tenderlove update Rakefiles for RDoc 2.5
tenderlove authored
77 RDoc::Task.new do |rdoc|
5aec933 @fxn quick hack: hijacks the predicate RDoc::Parser.binary? so that it doe…
fxn authored
78 hijack_rdoc!
79
a02d672 @jeremy Horo rdoc template
jeremy authored
80 rdoc.rdoc_dir = 'doc/rdoc'
81 rdoc.title = "Ruby on Rails Documentation"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
82
b50635a @tenderlove update Rakefiles for RDoc 2.5
tenderlove authored
83 rdoc.options << '-f' << 'horo'
728ba20 @fxn include the root README.rdoc as main page
fxn authored
84 rdoc.options << '-c' << 'utf-8'
85 rdoc.options << '-m' << 'README.rdoc'
86
87 rdoc.rdoc_files.include('README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
88
89 rdoc.rdoc_files.include('railties/CHANGELOG')
90 rdoc.rdoc_files.include('railties/MIT-LICENSE')
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
91 rdoc.rdoc_files.include('railties/README.rdoc')
d39ec81 @pixeltrix Make Railties RDoc task work again [#4291 state:resolved]
pixeltrix authored
92 rdoc.rdoc_files.include('railties/lib/**/*.rb')
93 rdoc.rdoc_files.exclude('railties/lib/rails/generators/**/templates/*')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
94
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
95 rdoc.rdoc_files.include('activerecord/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
96 rdoc.rdoc_files.include('activerecord/CHANGELOG')
97 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
98 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
99
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
100 rdoc.rdoc_files.include('activeresource/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
101 rdoc.rdoc_files.include('activeresource/CHANGELOG')
102 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
103 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
104
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
105 rdoc.rdoc_files.include('actionpack/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
106 rdoc.rdoc_files.include('actionpack/CHANGELOG')
413c9c8 @fxn adds Abstract Controller to the API
fxn authored
107 rdoc.rdoc_files.include('actionpack/lib/abstract_controller/**/*.rb')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
108 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
26bc5c5 @pixeltrix Add ActionDispatch to RDoc task [#4287 state:resolved]
pixeltrix authored
109 rdoc.rdoc_files.include('actionpack/lib/action_dispatch/**/*.rb')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
110 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
111 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
112
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
113 rdoc.rdoc_files.include('actionmailer/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
114 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
115 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
116 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
117
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
118 rdoc.rdoc_files.include('activesupport/README.rdoc')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
119 rdoc.rdoc_files.include('activesupport/CHANGELOG')
120 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
121 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
9fd9e5d @fxn fixes doc generation
fxn authored
122
508fba9 @josevalim Add .rdoc extension to README files.
josevalim authored
123 rdoc.rdoc_files.include('activemodel/README.rdoc')
9fd9e5d @fxn fixes doc generation
fxn authored
124 rdoc.rdoc_files.include('activemodel/CHANGELOG')
125 rdoc.rdoc_files.include('activemodel/lib/active_model/**/*.rb')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
126 end
127
128 # Enhance rdoc task to copy referenced images also
129 task :rdoc do
a02d672 @jeremy Horo rdoc template
jeremy authored
130 FileUtils.mkdir_p "doc/rdoc/files/examples/"
131 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
132 end
133
fcdedb2 @jeremy Bump version to 3.0.1.pre
jeremy authored
134 desc 'Bump all versions to match version.rb'
b1769fe @brynary Add `rake update_versions` task at root for quickly updating all comp…
brynary authored
135 task :update_versions do
deb00bc @brynary Read Rails version from a file instead of modifying the load path and…
brynary authored
136 require File.dirname(__FILE__) + "/version"
137
138 File.open("RAILS_VERSION", "w") do |f|
139 f.write Rails::VERSION::STRING + "\n"
140 end
141
b1769fe @brynary Add `rake update_versions` task at root for quickly updating all comp…
brynary authored
142 constants = {
143 "activesupport" => "ActiveSupport",
144 "activemodel" => "ActiveModel",
145 "actionpack" => "ActionPack",
146 "actionmailer" => "ActionMailer",
147 "activeresource" => "ActiveResource",
148 "activerecord" => "ActiveRecord",
149 "railties" => "Rails"
150 }
151
152 version_file = File.read("version.rb")
153
154 PROJECTS.each do |project|
155 Dir["#{project}/lib/*/version.rb"].each do |file|
156 File.open(file, "w") do |f|
157 f.write version_file.gsub(/Rails/, constants[project])
158 end
159 end
160 end
161 end
Something went wrong with that request. Please try again.