semvergen 1.9.2 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/semvergen/bump.rb +9 -11
- data/lib/semvergen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4ef8e452d8a53aa6417e0722385b10fbe2297ca
|
4
|
+
data.tar.gz: fcfc631839053b44a16fcf5c92a25ee946f7cff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6713702e5d09dfc2da2d0e50c157fac7df9be8b7706ae65e1418efd8f0870285a70cfe205d37e60a6ba7150486edd75f4f1da9a4e0be7d40d4b7430a37edc55
|
7
|
+
data.tar.gz: abe39ff378496f8ebef08dc54f3466d10b27197595ff6d42d0542501aaa750a7c79eeeb98b043120cd150c1f5465242c269cc2406260ed630841a419063ec8e7
|
data/CHANGELOG.md
CHANGED
data/lib/semvergen/bump.rb
CHANGED
@@ -8,12 +8,6 @@ module Semvergen
|
|
8
8
|
MINOR = "Minor: New features, but backwards compatible"
|
9
9
|
MAJOR = "Major: Breaking changes"
|
10
10
|
|
11
|
-
RELEASE_TYPES = [
|
12
|
-
PATCH,
|
13
|
-
MINOR,
|
14
|
-
MAJOR
|
15
|
-
]
|
16
|
-
|
17
11
|
def_delegators :@interface, :say, :ask, :color, :choose, :newline, :agree
|
18
12
|
|
19
13
|
def initialize(interface, version_file, node_version_file, change_log_file, shell, gem_name, gem_server, notifier)
|
@@ -28,7 +22,8 @@ module Semvergen
|
|
28
22
|
end
|
29
23
|
|
30
24
|
def run!(options)
|
31
|
-
|
25
|
+
master_release = @shell.current_branch == "master"
|
26
|
+
unless master_release
|
32
27
|
say color("You are not on master. It is not recommended to create releases from a branch unless they're maintenance releases", :red)
|
33
28
|
newline
|
34
29
|
return unless agree("Proceed anyway? ")
|
@@ -57,14 +52,17 @@ module Semvergen
|
|
57
52
|
|
58
53
|
newline
|
59
54
|
|
55
|
+
# Only patches allowed for maintenance releases
|
56
|
+
release_types = master_release ? [PATCH, MINOR, MAJOR] : [PATCH]
|
57
|
+
|
60
58
|
release_type = choose do |menu|
|
61
59
|
menu.header = "Select release type"
|
62
60
|
menu.default = "1"
|
63
61
|
menu.select_by = :index
|
64
|
-
menu.choices *
|
62
|
+
menu.choices *release_types
|
65
63
|
end
|
66
64
|
|
67
|
-
new_version = next_version(@version_file.version, release_type)
|
65
|
+
new_version = next_version(@version_file.version, release_type, release_types)
|
68
66
|
|
69
67
|
newline
|
70
68
|
|
@@ -155,10 +153,10 @@ module Semvergen
|
|
155
153
|
end
|
156
154
|
end
|
157
155
|
|
158
|
-
def next_version(current_version, release_type)
|
156
|
+
def next_version(current_version, release_type, release_types)
|
159
157
|
version_tuples = current_version.split(".")
|
160
158
|
|
161
|
-
release_index = 2 -
|
159
|
+
release_index = 2 - release_types.index(release_type)
|
162
160
|
|
163
161
|
bumping = version_tuples[release_index]
|
164
162
|
unchanged = version_tuples[0...release_index]
|
data/lib/semvergen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semvergen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brendon McLean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|