bump_gem_version 0.1.4 → 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: 603350e913c2f96e977ab8322189623061ebae839f475f5d93714cb1f60954ab
4
- data.tar.gz: d2e9d69fc1a178415ece01586ad5191bc25ad3dbd0a95561b338a62f4c339d45
3
+ metadata.gz: fa5d2adb23ff50708ab189201260d41b3f67a5bc4f5a213f6c7a270c41737d9d
4
+ data.tar.gz: e5f290ead367188c1492245c0c5a9f6521211eee989064b67556cf497f31f0af
5
5
  SHA512:
6
- metadata.gz: 42f4669eef2fb1fddffb56828504d47cdd859de40d828b8390875e7c5c17c71d936dc899c9ae7a12fe362f479e4037377655cc355befc85bdac4f915e946def1
7
- data.tar.gz: 8fcf11e16d5a80046ed81522c050c5350a71e3bbf7aab3883c04ba776c7838d7281cd1a1a5b7ca0f42ed4ab54afa70b89db9ffee42b6165361a15e8f9a59ea30
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,13 @@
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
+
7
+ ## [0.1.5] - 2023-03-29
8
+
9
+ - Fixed: REGEX used to retrieve the current gem name.
10
+
3
11
  ## [0.1.4] - 2023-03-05
4
12
 
5
13
  - Added: `exact` method to bump version to the given version.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bump_gem_version (0.1.4)
4
+ bump_gem_version (0.1.6)
5
5
  thor (~> 1.2)
6
6
 
7
7
  GEM
@@ -9,15 +9,15 @@ GEM
9
9
  specs:
10
10
  ast (2.4.2)
11
11
  json (2.6.3)
12
- minitest (5.17.0)
12
+ minitest (5.18.0)
13
13
  parallel (1.22.1)
14
- parser (3.2.1.0)
14
+ parser (3.2.2.0)
15
15
  ast (~> 2.4.1)
16
16
  rainbow (3.1.1)
17
17
  rake (13.0.6)
18
18
  regexp_parser (2.7.0)
19
19
  rexml (3.2.5)
20
- rubocop (1.46.0)
20
+ rubocop (1.48.1)
21
21
  json (~> 2.3)
22
22
  parallel (~> 1.10)
23
23
  parser (>= 3.2.0.0)
@@ -27,13 +27,13 @@ GEM
27
27
  rubocop-ast (>= 1.26.0, < 2.0)
28
28
  ruby-progressbar (~> 1.7)
29
29
  unicode-display_width (>= 2.4.0, < 3.0)
30
- rubocop-ast (1.26.0)
30
+ rubocop-ast (1.28.0)
31
31
  parser (>= 3.2.1.0)
32
- rubocop-minitest (0.28.0)
32
+ rubocop-minitest (0.29.0)
33
33
  rubocop (>= 1.39, < 2.0)
34
34
  rubocop-rake (0.6.0)
35
35
  rubocop (~> 1.0)
36
- ruby-progressbar (1.11.0)
36
+ ruby-progressbar (1.13.0)
37
37
  thor (1.2.1)
38
38
  unicode-display_width (2.4.2)
39
39
 
@@ -50,4 +50,4 @@ DEPENDENCIES
50
50
  rubocop-rake (~> 0.6)
51
51
 
52
52
  BUNDLED WITH
53
- 2.4.7
53
+ 2.4.10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BumpGemVersion
4
- VERSION = "0.1.4"
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
@@ -108,7 +121,7 @@ module BumpGemVersion
108
121
 
109
122
  def current_gem_name
110
123
  gemspec = Dir.glob("*.gemspec").first
111
- File.read(gemspec)[/spec\.name\s+=\s+['"](.+)['"]/i, 1]
124
+ File.read(gemspec)[/\.name\s+=\s+['"](.+)['"]/i, 1]
112
125
  end
113
126
  end
114
127
  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.4
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-05 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
@@ -121,7 +121,7 @@ licenses:
121
121
  metadata:
122
122
  homepage_uri: https://rubygems.org/gems/bump_gem_version
123
123
  source_code_uri: https://github.com/thejus-paul/bump_gem_version
124
- changelog_uri: https://github.com/thejus-paul/bump_gem_version/CHANGELOG.md
124
+ changelog_uri: https://github.com/Thejus-Paul/bump_gem_version/blob/main/CHANGELOG.md
125
125
  rubygems_mfa_required: 'true'
126
126
  post_install_message:
127
127
  rdoc_options: []
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.4.7
141
+ rubygems_version: 3.4.10
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: BumpGemVersion is a gem that will simplify the way you build gems.