Rakefile in newgem-0.10.0 vs Rakefile in newgem-0.10.1
- old
+ new
@@ -1,8 +1,9 @@
require 'rubygems'
require 'rake'
require 'rake/clean'
+require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
@@ -12,10 +13,12 @@
AUTHOR = "Dr Nic Williams"
EMAIL = "drnicwilliams@gmail.com"
DESCRIPTION = "Make your own gems at home"
GEM_NAME = "newgem" # what ppl will type to install your gem
+config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
+RUBYFORGE_USERNAME = config["username"]
RUBYFORGE_PROJECT = "newgem"
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
@@ -40,17 +43,21 @@
p.clean_globs = CLEAN #An array of file patterns to delete on clean.
# == Optional
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
p.extra_deps = [
- ['hoe', '>=1.2.0'],
+ ['hoe', '>=1.2.1'],
['RedCloth','>=3.0.4'],
['syntax','>=1.0.0']
]
#p.spec_extras - A hash of extra values to set in the gemspec.
end
+CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
+PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "\#{RUBYFORGE_PROJECT}/\#{GEM_NAME}"
+hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}/,''), 'rdoc')
+
desc 'Generate website files'
task :website_generate => :load_consts do
(Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
end
@@ -79,10 +86,16 @@
ENV['HOMEPATH'] = HOMEPATH
ENV['DOWNLOAD_PATH'] = DOWNLOAD_PATH
end
desc 'Release the website and new gem version'
-task :deploy => [:check_version, :website, :release]
+task :deploy => [:check_version, :website, :publish_docs, :release] do
+ puts "Remember to create SVN tag:"
+ puts "svn copy svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/trunk " +
+ "svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
+ puts "Suggested comment:"
+ puts "Tagging release #{CHANGES}"
+end
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
task :local_deploy => [:website_generate, :install_gem]
task :check_version do