Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 127 lines (104 sloc) 4.655 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'
8ff310a Break up rails and railties:
Carlhuda authored
3 require 'rake/gempackagetask'
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
4
5 env = %(PKG_BUILD="#{ENV['PKG_BUILD']}") if ENV['PKG_BUILD']
6
8ff310a Break up rails and railties:
Carlhuda authored
7 PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
8
9 Dir["#{File.dirname(__FILE__)}/*/lib/*/version.rb"].each do |version_path|
10 require version_path
11 end
12
13 desc 'Run all tests by default'
bbb3e5a @jeremy Unify test:isolated across components and run by default at toplevel
jeremy authored
14 task :default => %w(test test:isolated)
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
15
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
16 %w(test test:isolated rdoc pgem package gem gemspec).each do |task_name|
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
17 desc "Run #{task_name} task for all projects"
18 task task_name do
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
19 errors = []
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
20 PROJECTS.each do |project|
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
21 system(%(cd #{project} && #{env} #{$0} #{task_name})) || errors << project
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
22 end
49afe81 @kerryb Report errors in 'all project' rake tasks [#2224 state:resolved]
kerryb authored
23 fail("Errors in #{errors.join(', ')}") unless errors.empty?
8922c5d @jeremy Add toplevel Rakefile to run tests, generate docs, etc en masse
jeremy authored
24 end
25 end
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
26
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
27 desc "Smoke-test all projects"
28 task :smoke do
29 (PROJECTS - %w(activerecord)).each do |project|
30 system %(cd #{project} && #{env} #{$0} test:isolated)
31 end
32 system %(cd activerecord && #{env} #{$0} sqlite3:isolated_test)
33 end
8ff310a Break up rails and railties:
Carlhuda authored
34
a76af23 @jeremy rake smoke: toplevel task to quickly smoke-test all projects
jeremy authored
35 spec = eval(File.read('rails.gemspec'))
8ff310a Break up rails and railties:
Carlhuda authored
36 Rake::GemPackageTask.new(spec) do |pkg|
37 pkg.gem_spec = spec
38 end
39
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
40 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
41 task :release => :release_projects do
42 require 'rake/gemcutter'
43 Rake::Gemcutter::Tasks.new(spec).define
44 Rake::Task['gem:push'].invoke
45 end
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
46
47 desc "Release all components to gemcutter."
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
48 task :release_projects => :package do
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
49 errors = []
50 PROJECTS.each do |project|
51 system(%(cd #{project} && #{env} #{$0} release)) || errors << project
52 end
53 fail("Errors in #{errors.join(', ')}") unless errors.empty?
54 end
55
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
56 task :install => :gem do
57 (PROJECTS - ["railties"]).each do |project|
8ff310a Break up rails and railties:
Carlhuda authored
58 puts "INSTALLING #{project}"
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
59 system("gem install #{project}/pkg/#{project}-#{ActionPack::VERSION::STRING}.gem --no-ri --no-rdoc")
60 end
8ff310a Break up rails and railties:
Carlhuda authored
61 system("gem install railties/pkg/railties-#{ActionPack::VERSION::STRING}.gem --no-ri --no-rdoc")
62 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
63 end
64
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
65 desc "Generate documentation for the Rails framework"
66 Rake::RDocTask.new do |rdoc|
a02d672 @jeremy Horo rdoc template
jeremy authored
67 rdoc.rdoc_dir = 'doc/rdoc'
68 rdoc.title = "Ruby on Rails Documentation"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
69
70 rdoc.options << '--line-numbers' << '--inline-source'
71 rdoc.options << '-A cattr_accessor=object'
72 rdoc.options << '--charset' << 'utf-8'
73
a02d672 @jeremy Horo rdoc template
jeremy authored
74 rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
75
76 rdoc.rdoc_files.include('railties/CHANGELOG')
77 rdoc.rdoc_files.include('railties/MIT-LICENSE')
78 rdoc.rdoc_files.include('railties/README')
5021dc6 @josevalim Vendorized Thor.
josevalim authored
79 rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,generators/*.rb}')
80 rdoc.rdoc_files.exclude('railties/lib/vendor/*')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
81
82 rdoc.rdoc_files.include('activerecord/README')
83 rdoc.rdoc_files.include('activerecord/CHANGELOG')
84 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
85 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
86
87 rdoc.rdoc_files.include('activeresource/README')
88 rdoc.rdoc_files.include('activeresource/CHANGELOG')
89 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
90 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
91
92 rdoc.rdoc_files.include('actionpack/README')
93 rdoc.rdoc_files.include('actionpack/CHANGELOG')
94 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
95 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
96 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
97
98 rdoc.rdoc_files.include('actionmailer/README')
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
103 rdoc.rdoc_files.include('activesupport/README')
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
108 rdoc.rdoc_files.include('activemodel/README')
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 …
jeremy authored
121 require 'rake/contrib/sshpublisher'
a02d672 @jeremy Horo rdoc template
jeremy authored
122 Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc/rdoc").upload
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
123 PROJECTS.each do |project|
81025b5 @jeremy fix toplevel pdoc task
jeremy authored
124 system %(cd #{project} && #{env} #{$0} pdoc)
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
125 end
126 end
Something went wrong with that request. Please try again.