Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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