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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d36c4ba56d484687ecf22c1f3d5b465f1d4de5e
4
- data.tar.gz: a22a032fe0178cbdae36946cdb496d61cd5f2535
3
+ metadata.gz: f4ef8e452d8a53aa6417e0722385b10fbe2297ca
4
+ data.tar.gz: fcfc631839053b44a16fcf5c92a25ee946f7cff5
5
5
  SHA512:
6
- metadata.gz: 2889b5ef6ac669af65b84830366146cd2d865eeac815cbf12631a2475217892aa82eb3d7e15abd04b0b6ff30d008a6c0a03050ed09cfaeb51c036ee06a792d97
7
- data.tar.gz: 80794b5ad9ab14232a6fe76f30b897f4f3ccaf27d83a6a2d4f7a45c193b3468601fcc762d020a9cf8facbd92a6e451423ab2d8ba869cf1276f36dd3d241c4439
6
+ metadata.gz: a6713702e5d09dfc2da2d0e50c157fac7df9be8b7706ae65e1418efd8f0870285a70cfe205d37e60a6ba7150486edd75f4f1da9a4e0be7d40d4b7430a37edc55
7
+ data.tar.gz: abe39ff378496f8ebef08dc54f3466d10b27197595ff6d42d0542501aaa750a7c79eeeb98b043120cd150c1f5465242c269cc2406260ed630841a419063ec8e7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 1.10.0
4
+ * Prevent anything except patches when not on master
5
+
6
+
3
7
  # 1.9.2
4
8
  * Fix release command
5
9
 
@@ -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
- unless @shell.current_branch == "master"
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 *RELEASE_TYPES
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 - RELEASE_TYPES.index(release_type)
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]
@@ -1,3 +1,3 @@
1
1
  module Semvergen
2
- VERSION = "1.9.2"
2
+ VERSION = "1.10.0"
3
3
  end
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.9.2
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-13 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline