Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 681 Bytes
require "bundler"
task :default do
sh "rspec spec/"
rule /^version:bump:.*/ do |t|
file = 'lib/vendorer/version.rb'
sh "git status | grep 'nothing to commit'" # ensure we are not dirty
index = ['major', 'minor','patch'].index(':').last)
version_file =
old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
version_parts[index] = version_parts[index].to_i + 1
new_version = version_parts * '.','w'){|f| f.write(version_file.sub(old_version, new_version)) }
sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
Something went wrong with that request. Please try again.