Rakefile in rubygems-update-2.1.0.rc.1 vs Rakefile in rubygems-update-2.1.0.rc.2
- old
+ new
@@ -23,11 +23,10 @@
Hoe.plugin :minitest
Hoe.plugin :git
Hoe.plugin :travis
hoe = Hoe.spec 'rubygems-update' do
- self.rubyforge_name = 'rubygems'
self.author = ['Jim Weirich', 'Chad Fowler', 'Eric Hodel']
self.email = %w[rubygems-developers@rubyforge.org]
self.readme_file = 'README.rdoc'
license 'Ruby'
@@ -58,34 +57,39 @@
dependency 'minitest', '~> 4.0', :dev
self.extra_rdoc_files = Dir["*.rdoc"]
spec_extras['rdoc_options'] = proc do |rdoc_options|
- rdoc_options << "--title=RubyGems #{self.version} Documentation"
+ rdoc_options << "--title=RubyGems Update Documentation"
end
self.rsync_args += " --no-p -O"
- # FIX: this exists because update --system installs the gem and
- # doesn't uninstall it. It should uninstall or better, not install
- # in the first place.
- spec_extras['require_paths'] = %w[hide_lib_for_update] unless
- ENV['RAKE_SUCKS']
+ spec_extras['require_paths'] = %w[hide_lib_for_update]
end
hoe.test_prelude = 'gem "minitest", "~> 4.0"'
-task :docs => :rake_sucks
-task :rake_sucks do
- # This exists ENTIRELY because the rake design convention of
- # RDocTask.new is broken. Because most of the work is being done
- # inside initialize(?!?) BEFORE tasks are even running, too much
- # stuff is set in stone, and we can't deal with the require_paths
- # issue above.
- unless ENV['RAKE_SUCKS'] then
- ENV['RAKE_SUCKS'] = "1"
- rm_rf "doc"
- sh "rake docs"
+Rake::Task['docs'].clear
+Rake::Task['clobber_docs'].clear
+
+begin
+ require 'rdoc/task'
+
+ RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
+ doc.main = hoe.readme_file
+ doc.title = "RubyGems #{hoe.version} API Documentation"
+
+ rdoc_files = Rake::FileList.new %w[lib History.txt LICENSE.txt MIT.txt]
+ rdoc_files.add hoe.extra_rdoc_files
+
+ doc.rdoc_files = rdoc_files
+
+ doc.rdoc_dir = 'doc'
+ end
+rescue LoadError, RuntimeError # rake 10.1 on rdoc from ruby 1.9.2 and earlier
+ task 'docs' do
+ abort 'You must install rdoc to build documentation, try `rake newb` again'
end
end
task :clean_env do
ENV.delete "GEM_HOME"