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