Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

67 lines (54 sloc) 1.626 kB
require File.expand_path('../lib/cequel/version', __FILE__)
require 'rspec/core/rake_task'
task :default => :release
task :release => [:verify_changelog, :test, :build, :tag, :update_stable, :push, :cleanup]
desc 'Build gem'
task :build do
system 'gem build cequel.gemspec'
end
desc 'Create git release tag'
task :tag do
system "git tag -a -m 'Version #{Cequel::VERSION}' #{Cequel::VERSION}"
system "git push origin #{Cequel::VERSION}:#{Cequel::VERSION}"
end
desc 'Update stable branch on GitHub'
task :update_stable do
if Cequel::VERSION =~ /^(\d+\.)+\d+$/ # Don't push for prerelease
system "git push -f origin HEAD:stable"
end
end
desc 'Push gem to repository'
task :push do
system "gem push cequel-#{Cequel::VERSION}.gem"
end
task 'Push gem to geminabox'
task :inabox do
system "gem inabox cequel-#{Cequel::VERSION}.gem"
end
task 'Remove packaged gems'
task :cleanup do
system "rm -v *.gem"
end
desc 'Run the specs'
task :test do
abort unless system 'bundle', 'exec', 'rspec', 'spec/examples'
end
desc 'Update changelog'
task :changelog do
require './lib/cequel/version.rb'
last_tag = `git tag`.each_line.map(&:strip).last
existing_changelog = File.read('./CHANGELOG.md')
File.open('./CHANGELOG.md', 'w') do |f|
f.puts "## #{Cequel::VERSION}"
f.puts ""
f.puts `git log --no-merges --pretty=format:'* %s' #{last_tag}..`
f.puts ""
f.puts existing_changelog
end
end
task :verify_changelog do
require './lib/cequel/version.rb'
if File.read('./CHANGELOG.md').each_line.first.strip != "## #{Cequel::VERSION}"
abort "Changelog is not up-to-date."
end
end
Jump to Line
Something went wrong with that request. Please try again.