Permalink
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (34 sloc) 787 Bytes
require 'rubygems'
require 'rake'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
desc 'Build the gem'
task :build do
system "gem build jasmine-sauce.gemspec"
end
desc 'Release gem to rubygems.org'
task :release => :build do
system "gem push `ls *.gem | sort | tail -n 1`"
end
desc 'tag current version'
task :tag do
version = nil
File.open("jasmine-sauce.gemspec").each do |line|
if line =~ /s.version = "(.*)"/
version = $1
end
end
if version.nil?
raise "Couldn't find version"
end
system "git tag v#{version}"
end
desc 'push to github'
task :push do
system "git push origin master --tags"
end
task :default => [:tag, :release, :push]