Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 109 lines (89 sloc) 4.227 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
bbb3e5a @jeremy Unify test:isolated across components and run by default at toplevel
jeremy authored
16 %w(test test:isolated rdoc pgem package release 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
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
40 task :install => :gem do
8ff310a Break up rails and railties:
Carlhuda authored
41 system %(cd arel && gem build arel.gemspec && gem install arel-0.2.pre.gem --no-ri --no-rdoc --ignore-dependencies)
42 system %(cd rack && rake gem VERSION=1.0.2.pre && gem install rack-1.0.2.pre.gem --no-ri --no-rdoc --ignore-dependencies)
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
43 (PROJECTS - ["railties"]).each do |project|
8ff310a Break up rails and railties:
Carlhuda authored
44 puts "INSTALLING #{project}"
f3ed0de @wycats Create an install task that successfully installs all Rails gems
wycats authored
45 system("gem install #{project}/pkg/#{project}-#{ActionPack::VERSION::STRING}.gem --no-ri --no-rdoc")
46 end
8ff310a Break up rails and railties:
Carlhuda authored
47 system("gem install railties/pkg/railties-#{ActionPack::VERSION::STRING}.gem --no-ri --no-rdoc")
48 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
49 end
50
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
51 desc "Generate documentation for the Rails framework"
52 Rake::RDocTask.new do |rdoc|
a02d672 @jeremy Horo rdoc template
jeremy authored
53 rdoc.rdoc_dir = 'doc/rdoc'
54 rdoc.title = "Ruby on Rails Documentation"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
55
56 rdoc.options << '--line-numbers' << '--inline-source'
57 rdoc.options << '-A cattr_accessor=object'
58 rdoc.options << '--charset' << 'utf-8'
59
a02d672 @jeremy Horo rdoc template
jeremy authored
60 rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
61
62 rdoc.rdoc_files.include('railties/CHANGELOG')
63 rdoc.rdoc_files.include('railties/MIT-LICENSE')
64 rdoc.rdoc_files.include('railties/README')
5021dc6 @josevalim Vendorized Thor.
josevalim authored
65 rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,generators/*.rb}')
66 rdoc.rdoc_files.exclude('railties/lib/vendor/*')
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
67
68 rdoc.rdoc_files.include('activerecord/README')
69 rdoc.rdoc_files.include('activerecord/CHANGELOG')
70 rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
71 rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
72
73 rdoc.rdoc_files.include('activeresource/README')
74 rdoc.rdoc_files.include('activeresource/CHANGELOG')
75 rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
76 rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
77
78 rdoc.rdoc_files.include('actionpack/README')
79 rdoc.rdoc_files.include('actionpack/CHANGELOG')
80 rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
81 rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
82 rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
83
84 rdoc.rdoc_files.include('actionmailer/README')
85 rdoc.rdoc_files.include('actionmailer/CHANGELOG')
86 rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
87 rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
88
89 rdoc.rdoc_files.include('activesupport/README')
90 rdoc.rdoc_files.include('activesupport/CHANGELOG')
91 rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
92 rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
93 end
94
95 # Enhance rdoc task to copy referenced images also
96 task :rdoc do
a02d672 @jeremy Horo rdoc template
jeremy authored
97 FileUtils.mkdir_p "doc/rdoc/files/examples/"
98 FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
99 end
100
101 desc "Publish API docs for Rails as a whole and for each component"
102 task :pdoc => :rdoc do
4c96397 @jeremy Defer rake/contrib requires so we can use the stdlib rake instead of the...
jeremy authored
103 require 'rake/contrib/sshpublisher'
a02d672 @jeremy Horo rdoc template
jeremy authored
104 Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc/rdoc").upload
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
105 PROJECTS.each do |project|
81025b5 @jeremy fix toplevel pdoc task
jeremy authored
106 system %(cd #{project} && #{env} #{$0} pdoc)
4c720b7 @jeremy Add toplevel rdoc and pdoc tasks
jeremy authored
107 end
108 end
Something went wrong with that request. Please try again.