Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

switch to bump

  • Loading branch information...
commit b1da3b676f363a97af754ac8f7982503596eb786 1 parent a0638a6
@grosser authored
Showing with 4 additions and 17 deletions.
  1. +1 −0  Gemfile
  2. +2 −0  Gemfile.lock
  3. +1 −17 Rakefile
View
1  Gemfile
@@ -3,6 +3,7 @@ source :rubygems
gemspec
gem 'appraisal'
+gem 'bump'
gem 'rake'
gem 'rspec', '~>2'
gem 'sqlite3'
View
2  Gemfile.lock
@@ -23,6 +23,7 @@ GEM
rake
arel (3.0.2)
builder (3.0.4)
+ bump (0.3.5)
diff-lcs (1.1.3)
i18n (0.6.1)
multi_json (1.3.7)
@@ -44,6 +45,7 @@ PLATFORMS
DEPENDENCIES
appraisal
ar_after_transaction!
+ bump
rake
rspec (~> 2)
sqlite3
View
18 Rakefile
@@ -1,6 +1,7 @@
require "bundler/setup"
require "bundler/gem_tasks"
require "appraisal"
+require "bump/tasks"
task :spec do
@@ -10,20 +11,3 @@ end
task :default do
sh "bundle exec rake appraisal:install && bundle exec rake appraisal spec"
end
-
-# extracted from https://github.com/grosser/project_template
-rule /^version:bump:.*/ do |t|
- sh "git status | grep 'nothing to commit'" # ensure we are not dirty
- index = ['major', 'minor','patch'].index(t.name.split(':').last)
- file = 'lib/ar_after_transaction/version.rb'
-
- version_file = File.read(file)
- old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
- version_parts[index] = version_parts[index].to_i + 1
- version_parts[2] = 0 if index < 2 # remove patch for minor
- version_parts[1] = 0 if index < 1 # remove minor for major
- new_version = version_parts * '.'
- File.open(file,'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}'"
-end
Please sign in to comment.
Something went wrong with that request. Please try again.