Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bump

  • Loading branch information...
commit edd9a31a950668f9cd3e762f02cdeb7f2f0abf4a 1 parent dae3224
@grosser authored
Showing with 6 additions and 20 deletions.
  1. +3 −4 Gemfile
  2. +2 −0  Gemfile.lock
  3. +1 −16 Rakefile
View
7 Gemfile
@@ -1,7 +1,6 @@
source :rubygems
gemspec
-group :development do
- gem 'rake'
- gem 'rspec', '~>2'
-end
+gem 'rake'
+gem 'rspec', '~>2'
+gem 'bump'
View
2  Gemfile.lock
@@ -6,6 +6,7 @@ PATH
GEM
remote: http://rubygems.org/
specs:
+ bump (0.3.9)
diff-lcs (1.1.3)
rake (0.9.2)
rspec (2.6.0)
@@ -21,6 +22,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ bump
rake
rspec (~> 2)
zombie_passenger_killer!
View
17 Rakefile
@@ -1,21 +1,6 @@
require 'bundler/gem_tasks'
+require 'bump/tasks'
task :default do
sh "rspec spec/"
end
-
-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/zombie_passenger_killer/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.