midwire_common 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.md +1 -1
- data/lib/midwire_common/version.rb +1 -1
- data/lib/tasks/version.rake +30 -0
- metadata +3 -3
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/lib/tasks/version.rake
CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'readline'
|
4
4
|
require 'fileutils'
|
5
|
+
require 'pry'
|
5
6
|
|
6
7
|
module Bundler
|
7
8
|
class GemHelper
|
@@ -31,6 +32,7 @@ namespace :version do
|
|
31
32
|
|
32
33
|
desc "Increment the patch version and write changes to the changelog"
|
33
34
|
task :bump_patch do
|
35
|
+
exit unless check_branch
|
34
36
|
major, minor, patch = read_version
|
35
37
|
patch = patch.to_i + 1
|
36
38
|
write_version([major, minor, patch])
|
@@ -44,6 +46,7 @@ namespace :version do
|
|
44
46
|
|
45
47
|
desc "Increment the minor version and write changes to the changelog"
|
46
48
|
task :bump_minor do
|
49
|
+
exit unless check_branch
|
47
50
|
major, minor, patch = read_version
|
48
51
|
minor = minor.to_i + 1
|
49
52
|
patch = 0
|
@@ -53,6 +56,7 @@ namespace :version do
|
|
53
56
|
|
54
57
|
desc "Increment the major version and write changes to the changelog"
|
55
58
|
task :bump_major do
|
59
|
+
exit unless check_branch
|
56
60
|
major, minor, patch = read_version
|
57
61
|
major = major.to_i + 1
|
58
62
|
minor = 0
|
@@ -120,4 +124,30 @@ namespace :version do
|
|
120
124
|
end
|
121
125
|
response
|
122
126
|
end
|
127
|
+
|
128
|
+
def current_branch
|
129
|
+
`git rev-parse --abbrev-ref HEAD`.chomp
|
130
|
+
end
|
131
|
+
|
132
|
+
def check_branch
|
133
|
+
if current_branch == 'master'
|
134
|
+
puts "You typically do not want to bump versions on the 'master' branch"
|
135
|
+
puts "unless you plan to rebase or back-merge into the 'develop'."
|
136
|
+
puts ""
|
137
|
+
puts "If you don't care or don't know what I'm talking about just enter 'y'"
|
138
|
+
puts "and continue."
|
139
|
+
puts ""
|
140
|
+
puts "Optionally, you can hit 'n' to abort and switch your branch to 'develop'"
|
141
|
+
puts "or whatever branch you use for development, bump the version, merge to"
|
142
|
+
puts "'master' then 'rake release'."
|
143
|
+
puts ""
|
144
|
+
puts "Do you really want to bump the version on your 'master' branch? (y/n)"
|
145
|
+
while (line = $stdin.gets.chomp)
|
146
|
+
return true if line.match /[yY]/
|
147
|
+
puts "Aborting version bump."
|
148
|
+
return false
|
149
|
+
end
|
150
|
+
end
|
151
|
+
return true
|
152
|
+
end
|
123
153
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midwire_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
segments:
|
199
199
|
- 0
|
200
|
-
hash: -
|
200
|
+
hash: -1122474148263051726
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash: -
|
209
|
+
hash: -1122474148263051726
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
212
|
rubygems_version: 1.8.23
|