Skip to content
This repository
Browse code

allow the branch to be managed with a modern rake

  • Loading branch information...
commit 89322cd467fee8d4fcc16f67a9e7fce5817f746f 1 parent 4d47885
Xavier Noria authored April 22, 2013
124  Rakefile
... ...
@@ -1,20 +1,5 @@
1 1
 require 'rake'
2 2
 
3  
-if RAKEVERSION != '0.8.0'
4  
-  puts <<USAGE
5  
-In order to execute tasks please install Ruby 1.8.7 and rake 0.8.0. Then:
6  
-
7  
-    rake _0.8.0_ task_name
8  
-
9  
-Reason is the Jamis template used for the API needs RDoc 1.x. Recent rake libs
10  
-do not provide rake/rdoctask, and RDoc 1.x provides no alternative task. This
11  
-is easy to setup with a Ruby version manager.
12  
-USAGE
13  
-  exit 1
14  
-end
15  
-
16  
-require 'rake/rdoctask'
17  
-
18 3
 env = %(PKG_BUILD="#{ENV['PKG_BUILD']}") if ENV['PKG_BUILD']
19 4
 
20 5
 PROJECTS = %w(activesupport railties actionpack actionmailer activeresource activerecord)
@@ -30,58 +15,69 @@ task :default => :test
30 15
   desc "Run #{task_name} task for all projects"
31 16
   task task_name do
32 17
     PROJECTS.each do |project|
33  
-      system %(cd #{project} && #{env} rake _0.8.0_ #{task_name})
  18
+      system %(cd #{project} && #{env} rake _#{RAKEVERSION}_ #{task_name})
34 19
     end
35 20
   end
36 21
 end
37 22
 
38  
-desc "Generate documentation for the Rails framework"
39  
-Rake::RDocTask.new do |rdoc|
40  
-  rdoc.rdoc_dir = 'doc/rdoc'
41  
-  rdoc.title    = "Ruby on Rails Documentation"
42  
-  rdoc.main     = "railties/README"
43  
-
44  
-  rdoc.options << '--line-numbers' << '--inline-source'
45  
-  rdoc.options << '-A cattr_accessor=object'
46  
-  rdoc.options << '--charset' << 'utf-8'
47  
-  rdoc.options << '--main' << 'railties/README'
48  
-
49  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
50  
-
51  
-  rdoc.rdoc_files.include('railties/CHANGELOG')
52  
-  rdoc.rdoc_files.include('railties/MIT-LICENSE')
53  
-  rdoc.rdoc_files.include('railties/README')
54  
-  rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
55  
-
56  
-  rdoc.rdoc_files.include('activerecord/README')
57  
-  rdoc.rdoc_files.include('activerecord/CHANGELOG')
58  
-  rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
59  
-  rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
60  
-
61  
-  rdoc.rdoc_files.include('activeresource/README')
62  
-  rdoc.rdoc_files.include('activeresource/CHANGELOG')
63  
-  rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
64  
-  rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
65  
-
66  
-  rdoc.rdoc_files.include('actionpack/README')
67  
-  rdoc.rdoc_files.include('actionpack/CHANGELOG')
68  
-  rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
69  
-  rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
70  
-  rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
71  
-
72  
-  rdoc.rdoc_files.include('actionmailer/README')
73  
-  rdoc.rdoc_files.include('actionmailer/CHANGELOG')
74  
-  rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
75  
-  rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
76  
-
77  
-  rdoc.rdoc_files.include('activesupport/README')
78  
-  rdoc.rdoc_files.include('activesupport/CHANGELOG')
79  
-  rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
80  
-  rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
81  
-end
  23
+if RAKEVERSION == '0.8.0'
  24
+  require 'rake/rdoctask'
  25
+
  26
+  # In order to generate the API please install Ruby 1.8.7 and rake 0.8.0. Then:
  27
+  #
  28
+  #     rake _0.8.0_ task_name
  29
+  #
  30
+  # Reason is the Jamis template used for the API needs RDoc 1.x. Recent rake libs
  31
+  # do not provide rake/rdoctask, and RDoc 1.x provides no alternative task. This
  32
+  # is easy to setup with a Ruby version manager.
  33
+  desc "Generate documentation for the Rails framework"
  34
+  Rake::RDocTask.new do |rdoc|
  35
+    rdoc.rdoc_dir = 'doc/rdoc'
  36
+    rdoc.title    = "Ruby on Rails Documentation"
  37
+    rdoc.main     = "railties/README"
  38
+
  39
+    rdoc.options << '--line-numbers' << '--inline-source'
  40
+    rdoc.options << '-A cattr_accessor=object'
  41
+    rdoc.options << '--charset' << 'utf-8'
  42
+    rdoc.options << '--main' << 'railties/README'
  43
+
  44
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
  45
+
  46
+    rdoc.rdoc_files.include('railties/CHANGELOG')
  47
+    rdoc.rdoc_files.include('railties/MIT-LICENSE')
  48
+    rdoc.rdoc_files.include('railties/README')
  49
+    rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
  50
+
  51
+    rdoc.rdoc_files.include('activerecord/README')
  52
+    rdoc.rdoc_files.include('activerecord/CHANGELOG')
  53
+    rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
  54
+    rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
  55
+
  56
+    rdoc.rdoc_files.include('activeresource/README')
  57
+    rdoc.rdoc_files.include('activeresource/CHANGELOG')
  58
+    rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
  59
+    rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
  60
+
  61
+    rdoc.rdoc_files.include('actionpack/README')
  62
+    rdoc.rdoc_files.include('actionpack/CHANGELOG')
  63
+    rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
  64
+    rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
  65
+    rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
  66
+
  67
+    rdoc.rdoc_files.include('actionmailer/README')
  68
+    rdoc.rdoc_files.include('actionmailer/CHANGELOG')
  69
+    rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
  70
+    rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
  71
+
  72
+    rdoc.rdoc_files.include('activesupport/README')
  73
+    rdoc.rdoc_files.include('activesupport/CHANGELOG')
  74
+    rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
  75
+    rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
  76
+  end
82 77
 
83  
-# Enhance rdoc task to copy referenced images also
84  
-task :rdoc do
85  
-  FileUtils.mkdir_p "doc/rdoc/files/examples/"
86  
-  FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
  78
+  # Enhance rdoc task to copy referenced images also
  79
+  task :rdoc do
  80
+    FileUtils.mkdir_p "doc/rdoc/files/examples/"
  81
+    FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
  82
+  end
87 83
 end
42  actionmailer/Rakefile
... ...
@@ -1,9 +1,8 @@
1 1
 require 'rubygems'
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4  
-require 'rake/rdoctask'
5 4
 require 'rake/packagetask'
6  
-require 'rake/gempackagetask'
  5
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
7 6
 require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
8 7
 
9 8
 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -27,19 +26,21 @@ Rake::TestTask.new { |t|
27 26
   t.warning = false
28 27
 }
29 28
 
30  
-
31  
-# Generate the RDoc documentation
32  
-Rake::RDocTask.new { |rdoc|
33  
-  rdoc.rdoc_dir = 'doc'
34  
-  rdoc.title    = "Action Mailer -- Easy email delivery and testing"
35  
-  rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
36  
-  rdoc.options << '--charset' << 'utf-8'
37  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
38  
-  rdoc.rdoc_files.include('README', 'CHANGELOG')
39  
-  rdoc.rdoc_files.include('lib/action_mailer.rb')
40  
-  rdoc.rdoc_files.include('lib/action_mailer/*.rb')
41  
-}
42  
-
  29
+if RAKEVERSION == '0.8.0'
  30
+  require 'rake/rdoctask'
  31
+
  32
+  # Generate the RDoc documentation
  33
+  Rake::RDocTask.new do |rdoc|
  34
+    rdoc.rdoc_dir = 'doc'
  35
+    rdoc.title    = "Action Mailer -- Easy email delivery and testing"
  36
+    rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
  37
+    rdoc.options << '--charset' << 'utf-8'
  38
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  39
+    rdoc.rdoc_files.include('README', 'CHANGELOG')
  40
+    rdoc.rdoc_files.include('lib/action_mailer.rb')
  41
+    rdoc.rdoc_files.include('lib/action_mailer/*.rb')
  42
+  end
  43
+end
43 44
 
44 45
 # Create compressed packages
45 46
 spec = Gem::Specification.new do |s|
@@ -65,8 +66,9 @@ spec = Gem::Specification.new do |s|
65 66
   s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
66 67
   s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
67 68
 end
68  
-  
69  
-Rake::GemPackageTask.new(spec) do |p|
  69
+
  70
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  71
+package_task.new(spec) do |p|
70 72
   p.gem_spec = spec
71 73
   p.need_tar = true
72 74
   p.need_zip = true
@@ -80,12 +82,6 @@ task :pgem => [:package] do
80 82
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
81 83
 end
82 84
 
83  
-desc "Publish the API documentation"
84  
-task :pdoc => [:rdoc] do 
85  
-  require 'rake/contrib/sshpublisher'
86  
-  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload
87  
-end
88  
-
89 85
 desc "Publish the release files to RubyForge."
90 86
 task :release => [ :package ] do
91 87
   require 'rubyforge'
47  actionpack/Rakefile
... ...
@@ -1,9 +1,8 @@
1 1
 require 'rubygems'
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4  
-require 'rake/rdoctask'
5 4
 require 'rake/packagetask'
6  
-require 'rake/gempackagetask'
  5
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
7 6
 require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version')
8 7
 
9 8
 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -43,23 +42,26 @@ Rake::TestTask.new(:test_active_record_integration) do |t|
43 42
 end
44 43
 
45 44
 
46  
-# Genereate the RDoc documentation
47  
-
48  
-Rake::RDocTask.new { |rdoc|
49  
-  rdoc.rdoc_dir = 'doc'
50  
-  rdoc.title    = "Action Pack -- On rails from request to response"
51  
-  rdoc.options << '--line-numbers' << '--inline-source'
52  
-  rdoc.options << '--charset' << 'utf-8'
53  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
54  
-  if ENV['DOC_FILES'] 
55  
-    rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
56  
-  else
57  
-    rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
58  
-    rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
59  
-                            Dir['lib/*/vendor/**/*.rb'])
60  
-    rdoc.rdoc_files.exclude('lib/actionpack.rb')
  45
+if RAKEVERSION == '0.8.0'
  46
+  require 'rake/rdoctask'
  47
+
  48
+  # Generate the RDoc documentation
  49
+  Rake::RDocTask.new do |rdoc|
  50
+    rdoc.rdoc_dir = 'doc'
  51
+    rdoc.title    = "Action Pack -- On rails from request to response"
  52
+    rdoc.options << '--line-numbers' << '--inline-source'
  53
+    rdoc.options << '--charset' << 'utf-8'
  54
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  55
+    if ENV['DOC_FILES']
  56
+      rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
  57
+    else
  58
+      rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
  59
+      rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
  60
+                              Dir['lib/*/vendor/**/*.rb'])
  61
+      rdoc.rdoc_files.exclude('lib/actionpack.rb')
  62
+    end
61 63
   end
62  
-}
  64
+end
63 65
 
64 66
 # Create compressed packages
65 67
 dist_dirs = [ "lib", "test" ]
@@ -91,7 +93,8 @@ spec = Gem::Specification.new do |s|
91 93
   end
92 94
 end
93 95
   
94  
-Rake::GemPackageTask.new(spec) do |p|
  96
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  97
+package_task.new(spec) do |p|
95 98
   p.gem_spec = spec
96 99
   p.need_tar = true
97 100
   p.need_zip = true
@@ -141,12 +144,6 @@ task :pgem => [:package] do
141 144
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
142 145
 end
143 146
 
144  
-desc "Publish the API documentation"
145  
-task :pdoc => [:rdoc] do 
146  
-  require 'rake/contrib/sshpublisher'
147  
-  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload
148  
-end
149  
-
150 147
 desc "Publish the release files to RubyForge."
151 148
 task :release => [ :package ] do
152 149
   require 'rubyforge'
23  activemodel/Rakefile
... ...
@@ -1,7 +1,6 @@
1 1
 #!/usr/bin/env ruby
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4  
-require 'rake/rdoctask'
5 4
 
6 5
 task :default => :test
7 6
 
@@ -12,13 +11,17 @@ Rake::TestTask.new do |t|
12 11
   t.warning = true
13 12
 end
14 13
 
15  
-# Generate the RDoc documentation
16  
-Rake::RDocTask.new do |rdoc|
17  
-  rdoc.rdoc_dir = 'doc'
18  
-  rdoc.title    = "Active Model"
19  
-  rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
20  
-  rdoc.options << '--charset' << 'utf-8'
21  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
22  
-  rdoc.rdoc_files.include('README', 'CHANGES')
23  
-  rdoc.rdoc_files.include('lib/**/*.rb')
  14
+if RAKEVERSION == '0.8.0'
  15
+  require 'rake/rdoctask'
  16
+
  17
+  # Generate the RDoc documentation
  18
+  Rake::RDocTask.new do |rdoc|
  19
+    rdoc.rdoc_dir = 'doc'
  20
+    rdoc.title    = "Active Model"
  21
+    rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
  22
+    rdoc.options << '--charset' << 'utf-8'
  23
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  24
+    rdoc.rdoc_files.include('README', 'CHANGES')
  25
+    rdoc.rdoc_files.include('lib/**/*.rb')
  26
+  end
24 27
 end
42  activerecord/Rakefile
... ...
@@ -1,9 +1,8 @@
1 1
 require 'rubygems'
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4  
-require 'rake/rdoctask'
5 4
 require 'rake/packagetask'
6  
-require 'rake/gempackagetask'
  5
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
7 6
 
8 7
 require File.join(File.dirname(__FILE__), 'lib', 'active_record', 'version')
9 8
 require File.expand_path(File.dirname(__FILE__)) + "/test/config"
@@ -154,20 +153,22 @@ end
154 153
 task :build_frontbase_databases => 'frontbase:build_databases'
155 154
 task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
156 155
 
157  
-
158  
-# Generate the RDoc documentation
159  
-
160  
-Rake::RDocTask.new { |rdoc|
161  
-  rdoc.rdoc_dir = 'doc'
162  
-  rdoc.title    = "Active Record -- Object-relation mapping put on rails"
163  
-  rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
164  
-  rdoc.options << '--charset' << 'utf-8'
165  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
166  
-  rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
167  
-  rdoc.rdoc_files.include('lib/**/*.rb')
168  
-  rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
169  
-  rdoc.rdoc_files.include('dev-utils/*.rb')
170  
-}
  156
+if RAKEVERSION == '0.8.0'
  157
+  require 'rake/rdoctask'
  158
+
  159
+  # Generate the RDoc documentation
  160
+  Rake::RDocTask.new do |rdoc|
  161
+    rdoc.rdoc_dir = 'doc'
  162
+    rdoc.title    = "Active Record -- Object-relation mapping put on rails"
  163
+    rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
  164
+    rdoc.options << '--charset' << 'utf-8'
  165
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  166
+    rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
  167
+    rdoc.rdoc_files.include('lib/**/*.rb')
  168
+    rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
  169
+    rdoc.rdoc_files.include('dev-utils/*.rb')
  170
+  end
  171
+end
171 172
 
172 173
 # Enhance rdoc task to copy referenced images also
173 174
 task :rdoc do
@@ -211,7 +212,8 @@ spec = Gem::Specification.new do |s|
211 212
   s.rubyforge_project = "activerecord"
212 213
 end
213 214
 
214  
-Rake::GemPackageTask.new(spec) do |p|
  215
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  216
+package_task.new(spec) do |p|
215 217
   p.gem_spec = spec
216 218
   p.need_tar = true
217 219
   p.need_zip = true
@@ -251,12 +253,6 @@ task :pgem => [:package] do
251 253
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
252 254
 end
253 255
 
254  
-desc "Publish the API documentation"
255  
-task :pdoc => [:rdoc] do
256  
-  require 'rake/contrib/sshpublisher'
257  
-  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload
258  
-end
259  
-
260 256
 desc "Publish the release files to RubyForge."
261 257
 task :release => [ :package ] do
262 258
   require 'rubyforge'
40  activeresource/Rakefile
... ...
@@ -1,9 +1,8 @@
1 1
 require 'rubygems'
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4  
-require 'rake/rdoctask'
5 4
 require 'rake/packagetask'
6  
-require 'rake/gempackagetask'
  5
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
7 6
 
8 7
 require File.join(File.dirname(__FILE__), 'lib', 'active_resource', 'version')
9 8
 
@@ -35,19 +34,21 @@ Rake::TestTask.new { |t|
35 34
   t.warning = true
36 35
 }
37 36
 
38  
-
39  
-# Generate the RDoc documentation
40  
-
41  
-Rake::RDocTask.new { |rdoc|
42  
-  rdoc.rdoc_dir = 'doc'
43  
-  rdoc.title    = "Active Resource -- Object-oriented REST services"
44  
-  rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
45  
-  rdoc.options << '--charset' << 'utf-8'
46  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
47  
-  rdoc.rdoc_files.include('README', 'CHANGELOG')
48  
-  rdoc.rdoc_files.include('lib/**/*.rb')
49  
-  rdoc.rdoc_files.exclude('lib/activeresource.rb')
50  
-}
  37
+if RAKEVERSION == '0.8.0'
  38
+  require 'rake/rdoctask'
  39
+
  40
+  # Generate the RDoc documentation
  41
+  Rake::RDocTask.new do |rdoc|
  42
+    rdoc.rdoc_dir = 'doc'
  43
+    rdoc.title    = "Active Resource -- Object-oriented REST services"
  44
+    rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
  45
+    rdoc.options << '--charset' << 'utf-8'
  46
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  47
+    rdoc.rdoc_files.include('README', 'CHANGELOG')
  48
+    rdoc.rdoc_files.include('lib/**/*.rb')
  49
+    rdoc.rdoc_files.exclude('lib/activeresource.rb')
  50
+  end
  51
+end
51 52
 
52 53
 
53 54
 # Create compressed packages
@@ -81,7 +82,8 @@ spec = Gem::Specification.new do |s|
81 82
   s.rubyforge_project = "activeresource"
82 83
 end
83 84
   
84  
-Rake::GemPackageTask.new(spec) do |p|
  85
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  86
+package_task.new(spec) do |p|
85 87
   p.gem_spec = spec
86 88
   p.need_tar = true
87 89
   p.need_zip = true
@@ -121,12 +123,6 @@ task :pgem => [:package] do
121 123
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
122 124
 end
123 125
 
124  
-desc "Publish the API documentation"
125  
-task :pdoc => [:rdoc] do 
126  
-  require 'rake/contrib/sshpublisher'
127  
-  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload
128  
-end
129  
-
130 126
 desc "Publish the release files to RubyForge."
131 127
 task :release => [ :package ] do
132 128
   `rubyforge login`
41  activesupport/Rakefile
... ...
@@ -1,6 +1,5 @@
1 1
 require 'rake/testtask'
2  
-require 'rake/rdoctask'
3  
-require 'rake/gempackagetask'
  2
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
4 3
 
5 4
 require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
6 5
 
@@ -25,19 +24,22 @@ Rake::TestTask.new { |t|
25 24
 # Create compressed packages
26 25
 dist_dirs = [ "lib", "test"]
27 26
 
28  
-# Genereate the RDoc documentation
29  
-
30  
-Rake::RDocTask.new { |rdoc|
31  
-  rdoc.rdoc_dir = 'doc'
32  
-  rdoc.title    = "Active Support -- Utility classes and standard library extensions from Rails"
33  
-  rdoc.options << '--line-numbers' << '--inline-source'
34  
-  rdoc.options << '--charset' << 'utf-8'
35  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
36  
-  rdoc.rdoc_files.include('README', 'CHANGELOG')
37  
-  rdoc.rdoc_files.include('lib/active_support.rb')
38  
-  rdoc.rdoc_files.include('lib/active_support/**/*.rb')
39  
-  rdoc.rdoc_files.exclude('lib/active_support/vendor/*')
40  
-}
  27
+if RAKEVERSION == '0.8.0'
  28
+  require 'rake/rdoctask'
  29
+
  30
+  # Genereate the RDoc documentation
  31
+  Rake::RDocTask.new do |rdoc|
  32
+    rdoc.rdoc_dir = 'doc'
  33
+    rdoc.title    = "Active Support -- Utility classes and standard library extensions from Rails"
  34
+    rdoc.options << '--line-numbers' << '--inline-source'
  35
+    rdoc.options << '--charset' << 'utf-8'
  36
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  37
+    rdoc.rdoc_files.include('README', 'CHANGELOG')
  38
+    rdoc.rdoc_files.include('lib/active_support.rb')
  39
+    rdoc.rdoc_files.include('lib/active_support/**/*.rb')
  40
+    rdoc.rdoc_files.exclude('lib/active_support/vendor/*')
  41
+  end
  42
+end
41 43
 
42 44
 spec = Gem::Specification.new do |s|
43 45
   s.platform = Gem::Platform::RUBY
@@ -56,7 +58,8 @@ spec = Gem::Specification.new do |s|
56 58
   s.rubyforge_project = "activesupport"
57 59
 end
58 60
 
59  
-Rake::GemPackageTask.new(spec) do |p|
  61
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  62
+package_task.new(spec) do |p|
60 63
   p.gem_spec = spec
61 64
   p.need_tar = true
62 65
   p.need_zip = true
@@ -69,12 +72,6 @@ task :pgem => [:package] do
69 72
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
70 73
 end
71 74
 
72  
-desc "Publish the API documentation"
73  
-task :pdoc => [:rdoc] do 
74  
-  require 'rake/contrib/sshpublisher'
75  
-  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload
76  
-end
77  
-
78 75
 desc "Publish the release files to RubyForge."
79 76
 task :release => [ :package ] do
80 77
   require 'rubyforge'
42  railties/Rakefile
... ...
@@ -1,7 +1,6 @@
1 1
 require 'rake'
2 2
 require 'rake/testtask'
3  
-require 'rake/rdoctask'
4  
-require 'rake/gempackagetask'
  3
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
5 4
 
6 5
 require 'date'
7 6
 require 'rbconfig'
@@ -267,18 +266,22 @@ task :generate_app_doc do
267 266
   system %{cd #{PKG_DESTINATION}; rake doc:app}
268 267
 end
269 268
 
270  
-Rake::RDocTask.new { |rdoc|
271  
-  rdoc.rdoc_dir = 'doc'
272  
-  rdoc.title    = "Railties -- Gluing the Engine to the Rails"
273  
-  rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
274  
-  rdoc.options << '--charset' << 'utf-8'
275  
-  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
276  
-  rdoc.rdoc_files.include('README', 'CHANGELOG')
277  
-  rdoc.rdoc_files.include('lib/*.rb')
278  
-  rdoc.rdoc_files.include('lib/rails/*.rb')
279  
-  rdoc.rdoc_files.include('lib/rails_generator/*.rb')
280  
-  rdoc.rdoc_files.include('lib/commands/**/*.rb')
281  
-}
  269
+if RAKEVERSION == '0.8.0'
  270
+  require 'rake/rdoctask'
  271
+
  272
+  Rake::RDocTask.new do |rdoc|
  273
+    rdoc.rdoc_dir = 'doc'
  274
+    rdoc.title    = "Railties -- Gluing the Engine to the Rails"
  275
+    rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
  276
+    rdoc.options << '--charset' << 'utf-8'
  277
+    rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
  278
+    rdoc.rdoc_files.include('README', 'CHANGELOG')
  279
+    rdoc.rdoc_files.include('lib/*.rb')
  280
+    rdoc.rdoc_files.include('lib/rails/*.rb')
  281
+    rdoc.rdoc_files.include('lib/rails_generator/*.rb')
  282
+    rdoc.rdoc_files.include('lib/commands/**/*.rb')
  283
+  end
  284
+end
282 285
 
283 286
 # Generate GEM ----------------------------------------------------------------------------
284 287
 
@@ -334,7 +337,8 @@ spec = Gem::Specification.new do |s|
334 337
   s.rubyforge_project = "rails"
335 338
 end
336 339
 
337  
-Rake::GemPackageTask.new(spec) do |pkg|
  340
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
  341
+package_task.new(spec) do |pkg|
338 342
   pkg.gem_spec = spec
339 343
 end
340 344
 
@@ -346,14 +350,6 @@ task :pgem => [:gem] do
346 350
   `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
347 351
 end
348 352
 
349  
-desc "Publish the guides"
350  
-task :pguides => :generate_guides do
351  
-  mkdir_p 'pkg'
352  
-  `tar -czf pkg/guides.gz guides/output`
353  
-  Rake::SshFilePublisher.new("web.rubyonrails.org", "/u/sites/guides.rubyonrails.org/public", "pkg", "guides.gz").upload
354  
-  `ssh web.rubyonrails.org 'cd /u/sites/guides.rubyonrails.org/public/ && tar -xvzf guides.gz && mv guides/output/* . && rm -rf guides*'`
355  
-end
356  
-
357 353
 desc "Publish the release files to RubyForge."
358 354
 task :release => [ :package ] do
359 355
   require 'rake/contrib/rubyforgepublisher'

0 notes on commit 89322cd

Please sign in to comment.
Something went wrong with that request. Please try again.