bump_gem_version 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4fe11c46d8610c36ed079b6d9e098fd7776eb32b2ab6b685cf018b9cd62fcf3
4
- data.tar.gz: c574ae0534221b2038af4667557cf4f320d955be80ea05d1913c377747a2c752
3
+ metadata.gz: fa5d2adb23ff50708ab189201260d41b3f67a5bc4f5a213f6c7a270c41737d9d
4
+ data.tar.gz: e5f290ead367188c1492245c0c5a9f6521211eee989064b67556cf497f31f0af
5
5
  SHA512:
6
- metadata.gz: f774a6725cc68453aa7c4d7d84094aa844cba4f6d5ebde1717a44188cfe393ed694098b1e303a09ab0dce930590992d2c90b67c0fdfe40947ae2def3ccf4766f
7
- data.tar.gz: 38ec1e0cc4726af3a85f52e0c7364d3a1010c9acdc1c4729c5e6e9ac53299fbb2ffe9330858173cc2ba79963795bd65229a6bd7f4ae7b2891e8b4dc257fe5d3f
6
+ metadata.gz: 8e47d59475fccfdb1a81289e166cb026328e53ed05737447ae3e3c05dc6cb39b032eb261ba59e10491e3c6e71bb36d80885eb14999a53dbf71c9331253a9a4a3
7
+ data.tar.gz: 816f8742e158308f56a6a51c1c5459358521ac28b3ae1ce92227115dd026ad6ec66e2782d44dd42cc72085952d72b27ca2143b862f0e614513be1b36559e212e
data/.rubocop.yml CHANGED
@@ -16,3 +16,7 @@ Style/StringLiteralsInInterpolation:
16
16
 
17
17
  Layout/LineLength:
18
18
  Max: 120
19
+
20
+ Metrics/ClassLength:
21
+ Exclude:
22
+ - "./test/test_bump_gem_version.rb"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2023-04-01
4
+
5
+ - Added: Option to provide `default` bump label for the `labels` command.
6
+
3
7
  ## [0.1.5] - 2023-03-29
4
8
 
5
9
  - Fixed: REGEX used to retrieve the current gem name.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bump_gem_version (0.1.5)
4
+ bump_gem_version (0.1.6)
5
5
  thor (~> 1.2)
6
6
 
7
7
  GEM
@@ -11,7 +11,7 @@ GEM
11
11
  json (2.6.3)
12
12
  minitest (5.18.0)
13
13
  parallel (1.22.1)
14
- parser (3.2.1.1)
14
+ parser (3.2.2.0)
15
15
  ast (~> 2.4.1)
16
16
  rainbow (3.1.1)
17
17
  rake (13.0.6)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BumpGemVersion
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
@@ -22,10 +22,20 @@ module BumpGemVersion
22
22
  desc "patch", "Bump the patch version of your gem"
23
23
  def patch = bump_gem_version("patch")
24
24
 
25
- desc "label", "Bump the version of your gem from the given labels"
26
- def labels(labels)
27
- bump_type = labels.split(",").find { |label| BUMPS.include?(label) }
28
- bump_type ? bump_gem_version(bump_type) : puts("Error: Unable to find a valid bump label.")
25
+ desc "labels", "Bump the version of your gem from the given labels"
26
+ option(:default, desc: "Uses the given default label in case the label was not provided, \
27
+ or the given labels do not contain bump-type label.", banner: "LABEL", type: :string, aliases: "-d")
28
+ def labels(labels = options[:default])
29
+ bump_type = labels&.split(",")&.find { |label| BUMPS.include?(label) }
30
+
31
+ if bump_type.nil? && !BUMPS.include?(options[:default])
32
+ say_error("Unable to find a valid bump label or default label.", :red)
33
+ exit 1
34
+ end
35
+
36
+ return bump_gem_version(bump_type) unless bump_type.nil?
37
+
38
+ bump_gem_version(options[:default])
29
39
  end
30
40
 
31
41
  desc "exact", "Bump the version of your gem to the given version"
@@ -65,7 +75,10 @@ module BumpGemVersion
65
75
  version_from_version_rb ||
66
76
  version_from_lib_rb
67
77
  )
68
- puts "Error: Unable to find the version." unless version
78
+ unless version
79
+ say_error("Unable to find the version.", :red)
80
+ exit 1
81
+ end
69
82
 
70
83
  [version, file]
71
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bump_gem_version
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thejus Paul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-29 00:00:00.000000000 Z
11
+ date: 2023-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor