Permalink
Browse files

add bump

  • Loading branch information...
1 parent e01bb1a commit a9c22899ab369d35b53ebc0c999854e6e1837320 @grosser committed Nov 10, 2012
Showing with 8 additions and 21 deletions.
  1. +5 −4 Gemfile
  2. +2 −0 Gemfile.lock
  3. +1 −17 Rakefile
View
@@ -2,12 +2,13 @@ source :rubygems
gemspec
gem 'appraisal'
+gem 'bump'
+gem 'gettext'
gem 'haml'
-gem 'slim'
gem 'hamlet'
-gem 'ruby_parser', '~> 2.3' # 3 breaks haml/slim parsing
-gem 'gettext'
-gem 'sqlite3'
gem 'rails'
gem 'rake'
+gem 'ruby_parser', '~> 2.3' # 3 breaks haml/slim parsing
gem 'rspec'
+gem 'slim'
+gem 'sqlite3'
View
@@ -39,6 +39,7 @@ GEM
rake
arel (3.0.2)
builder (3.0.4)
+ bump (0.3.5)
diff-lcs (1.1.3)
erubis (2.7.0)
fast_gettext (0.6.11)
@@ -116,6 +117,7 @@ PLATFORMS
DEPENDENCIES
appraisal
+ bump
gettext
gettext_i18n_rails!
haml
View
@@ -1,5 +1,6 @@
require 'bundler/gem_tasks'
require 'appraisal'
+require 'bump/tasks'
task :spec do
sh "rspec spec"
@@ -8,20 +9,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|
- file = "lib/gettext_i18n_rails/version.rb"
-
- sh "git status | grep 'nothing to commit'" # ensure we are not dirty
- index = ["major", "minor", "patch"].index(t.name.split(':').last)
- 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

0 comments on commit a9c2289

Please sign in to comment.