Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: fd4a0044aa
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 0.852 kB
require 'rake/testtask'
desc 'Test, build and install the gem'
task :default => [:spec, :install]
Rake::TestTask.new(:spec) do |t|
t.pattern = 'spec/*_spec.rb'
end
desc 'Build and install the gem'
task :install do
gemspec_path = Dir['*.gemspec'].first
spec = eval(File.read(gemspec_path))
result = `gem build #{gemspec_path} 2>&1`
if result =~ /Successfully built/
system "gem uninstall -I #{spec.name} 2>&1"
system "gem install #{spec.file_name} --no-rdoc --no-ri 2>&1"
else
raise result
end
end
desc 'Take the version in the gemspec, create a git tag and send the gem to rubygems'
task :release do
gemspec_path = Dir['*.gemspec'].first
spec = eval(File.read(gemspec_path))
system "git tag -f -a v#{spec.version} -m 'Version #{spec.version}'"
system "git push --tags"
system "gem push #{spec.file_name}"
end
Jump to Line
Something went wrong with that request. Please try again.