Skip to content

Commit a702fd2

Browse files
committed
bump
1 parent 4cd9346 commit a702fd2

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

Gemfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
source :rubygems
22
gemspec
33

4-
group :development do
5-
gem 'test-unit', :platform => :ruby_19
6-
gem 'rspec', '>=2.4'
7-
gem 'cucumber'
8-
gem 'rake'
9-
end
4+
gem 'bump'
5+
gem 'test-unit', :platform => :ruby_19
6+
gem 'rspec', '>=2.4'
7+
gem 'cucumber'
8+
gem 'rake'

Gemfile.lock

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ GEM
88
remote: http://rubygems.org/
99
specs:
1010
builder (3.0.0)
11+
bump (0.3.8)
1112
cucumber (1.1.4)
1213
builder (>= 2.1.2)
1314
diff-lcs (>= 1.1.2)
@@ -35,6 +36,7 @@ PLATFORMS
3536
ruby
3637

3738
DEPENDENCIES
39+
bump
3840
cucumber
3941
parallel_tests!
4042
rake

Rakefile

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1+
require 'bump/tasks'
12
require 'bundler/gem_tasks'
23

34
task :default do
45
sh "rspec spec/"
56
end
6-
7-
# extracted from https://github.com/grosser/project_template
8-
rule /^version:bump:.*/ do |t|
9-
sh "git status | grep 'nothing to commit'" # ensure we are not dirty
10-
index = ['major', 'minor','patch'].index(t.name.split(':').last)
11-
file = 'lib/parallel_tests/version.rb'
12-
13-
version_file = File.read(file)
14-
old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
15-
version_parts[index] = version_parts[index].to_i + 1
16-
version_parts[2] = 0 if index < 2 # remove patch for minor
17-
version_parts[1] = 0 if index < 1 # remove minor for major
18-
new_version = version_parts * '.'
19-
File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
20-
21-
sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
22-
end

0 commit comments

Comments
 (0)