Skip to content

Commit

Permalink
Updating rake tasks to the latest version of Mr Bones. These tasks ha…
Browse files Browse the repository at this point in the history
…ve Git support.
  • Loading branch information
TwP committed Jun 3, 2008
1 parent db8bedd commit d024f89
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
12 changes: 10 additions & 2 deletions tasks/gem.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ namespace :gem do
end end


desc 'Install the gem' desc 'Install the gem'
task :install => [:clobber, :package] do task :install => [:clobber, 'gem:package'] do
sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}" sh "#{SUDO} #{GEM} install --local pkg/#{PROJ.gem._spec.full_name}"

# use this version of the command for rubygems > 1.0.0
#sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}"
end end


desc 'Uninstall the gem' desc 'Uninstall the gem'
Expand All @@ -106,6 +109,11 @@ namespace :gem do
desc 'Reinstall the gem' desc 'Reinstall the gem'
task :reinstall => [:uninstall, :install] task :reinstall => [:uninstall, :install]


desc 'Cleanup the gem'
task :cleanup do
sh "#{SUDO} #{GEM} cleanup #{PROJ.gem._spec.name}"
end

end # namespace :gem end # namespace :gem


desc 'Alias to gem:package' desc 'Alias to gem:package'
Expand Down
41 changes: 41 additions & 0 deletions tasks/git.rake
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,41 @@
# $Id$

if HAVE_GIT

namespace :git do

# A prerequisites task that all other tasks depend upon
task :prereqs

desc 'Show tags from the Git repository'
task :show_tags => 'git:prereqs' do |t|
puts %x/git tag/
end

desc 'Create a new tag in the Git repository'
task :create_tag => 'git:prereqs' do |t|
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version

tag = "%s-%s" % [PROJ.name, PROJ.version]
msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"

puts "Creating Git tag '#{tag}'"
unless system "git tag -a -m '#{msg}' #{tag}"
abort "Tag creation failed"
end

if %x/git remote/ =~ %r/^origin\s*$/
unless system "git push origin #{tag}"
abort "Could not push tag to remote Git repository"
end
end
end

end # namespace :git

task 'gem:release' => 'git:create_tag'

end # if HAVE_GIT

# EOF
2 changes: 1 addition & 1 deletion tasks/rubyforge.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require 'rake/contrib/sshpublisher'


namespace :gem do namespace :gem do
desc 'Package and upload to RubyForge' desc 'Package and upload to RubyForge'
task :release => [:clobber, :package] do |t| task :release => [:clobber, 'gem:package'] do |t|
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z' v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
pkg = "pkg/#{PROJ.gem._spec.full_name}" pkg = "pkg/#{PROJ.gem._spec.full_name}"
Expand Down

0 comments on commit d024f89

Please sign in to comment.