Commit a702fd2 1 parent 4cd9346 commit a702fd2 Copy full SHA for a702fd2
File tree 3 files changed +8
-23
lines changed
3 files changed +8
-23
lines changed Original file line number Diff line number Diff line change 1
1
source :rubygems
2
2
gemspec
3
3
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'
Original file line number Diff line number Diff line change 8
8
remote: http://rubygems.org/
9
9
specs:
10
10
builder (3.0.0 )
11
+ bump (0.3.8 )
11
12
cucumber (1.1.4 )
12
13
builder (>= 2.1.2 )
13
14
diff-lcs (>= 1.1.2 )
@@ -35,6 +36,7 @@ PLATFORMS
35
36
ruby
36
37
37
38
DEPENDENCIES
39
+ bump
38
40
cucumber
39
41
parallel_tests !
40
42
rake
Original file line number Diff line number Diff line change
1
+ require 'bump/tasks'
1
2
require 'bundler/gem_tasks'
2
3
3
4
task :default do
4
5
sh "rspec spec/"
5
6
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
You can’t perform that action at this time.
0 commit comments