runger_release_assistant 4.1.1 → 4.2.1

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: b0db4ae3ccdad86460829755ea81a12f5229ce7f3d57518ee358fea4408134cb
4
- data.tar.gz: cd02f9c95f730b0629c969ac340270f9bff501c3cc88e14d9adfdfbe88ffc3f9
3
+ metadata.gz: 9e5cf7362dd12d923b88713f84240ed0d110a0aebcaa02fb64f093894ba7f468
4
+ data.tar.gz: c0986cb869c96542d2fb9cc4e40f8f95da9d4759c871ff2bbd7819b3cd5597c8
5
5
  SHA512:
6
- metadata.gz: c11c344eee5f404ee0ec7c7b4ad99916df72d7886ec8e65f73a3f62c7f9b3d61d419150560927e40953e133098019cab3f859e4050e3b976d3fb6ba7b7eb4984
7
- data.tar.gz: d9877790dc5faaf50d895956a4f7870a783c5e9c7383b061911b446b76adaccfbb40aa7a1ae62a35b22a32843cd9530ff3eac32697eb9db0e83afc7ba9071226
6
+ metadata.gz: 7fe5c293094adc5ddeb32e45e853bca02936620698a187be3247bbfd677c0224ba1741bd82ca2292a196ba7423f26b8fb16c7eecb91d89678dcb25a80950ea42
7
+ data.tar.gz: f1ebfe8c4fd71a3fe084c2aa0d1e613fd2fbe935bb52c465abb5df6b333f9f22f7064d1a5677c261d518b616f0b2ce3e0ef8542b0f95a9d68e90ba6fa2e6c562
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  ## Unreleased
2
2
  [no unreleased changes yet]
3
3
 
4
+ ## v4.2.1 (2025-03-20)
5
+ ### Docs
6
+ - [README] Update table of contents.
7
+
8
+ ## v4.2.0 (2025-03-20)
9
+ - Fix README typo (most -> must).
10
+ - Look for latest tag using tag prefix.
11
+ - Print git tag names in yellow in pre-release info.
12
+
13
+ ### Docs
14
+ - Add info about telling bundler about a tag prefix.
15
+
4
16
  ## v4.1.1 (2025-03-20)
5
17
  ### Fixed
6
18
  - Fix `NoMethodError` trying to print `nil` in blue if there is no latest tag.
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_release_assistant (4.1.1)
12
+ runger_release_assistant (4.2.1)
13
13
  activesupport (>= 6)
14
14
  memo_wise (>= 1.7)
15
15
  rainbow (>= 3.0)
@@ -190,7 +190,7 @@ CHECKSUMS
190
190
  rubocop-rspec (3.5.0) sha256=710c942fe1af884ba8eea75cbb8bdbb051929a2208880a6fc2e2dce1eed5304c
191
191
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
192
192
  runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
193
- runger_release_assistant (4.1.1)
193
+ runger_release_assistant (4.2.1)
194
194
  runger_style (5.7.0) sha256=200790f3998e0b924df17efc9d440ddec99508bae983ba2a63f42b80624762f0
195
195
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
196
196
  slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
data/README.md CHANGED
@@ -17,12 +17,13 @@ versions via git/GitHub and (optionally) via RubyGems.
17
17
  * [Config](#config)
18
18
  * [Post-release command](#post-release-command)
19
19
  * [Using with RubyGems](#using-with-rubygems)
20
+ * [Tag prefix](#tag-prefix)
20
21
  * [Development](#development)
21
22
  * [Contributing](#contributing)
22
23
  * [License](#license)
23
24
 
24
25
  <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
25
- <!-- Added by: david, at: Wed Feb 5 04:11:40 AM CST 2025 -->
26
+ <!-- Added by: david, at: Thu Mar 20 02:14:42 PM CDT 2025 -->
26
27
 
27
28
  <!--te-->
28
29
 
@@ -140,8 +141,18 @@ By default, Git tags are created like `v1.0.0`. If you would like to prefix the
140
141
  tag_prefix: gem/
141
142
  ```
142
143
 
144
+ You must also provide this to bundler by putting something like the following in your `Rakefile`:
145
+
146
+ ```rb
147
+ require 'bundler/gem_tasks'
148
+ require 'runger_release_assistant'
149
+ Bundler::GemHelper.tag_prefix = RungerReleaseAssistant.new.tag_prefix
150
+ ```
151
+
143
152
  This example would generate tags in the form `gem/v1.0.0`.
144
153
 
154
+ Note that all version numbers in git tags will be prefixed with at least a `v`. The `tag_prefix` option is to specify an additional prefix, in addition to the `v`.
155
+
145
156
  ## Development
146
157
 
147
158
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
data/exe/release CHANGED
@@ -42,10 +42,4 @@ slop_options =
42
42
  end
43
43
  end
44
44
 
45
- config_file_options = RungerReleaseAssistant::ConfigFileReader.new.options_hash
46
-
47
- RungerReleaseAssistant.new(
48
- RungerReleaseAssistant::DEFAULT_OPTIONS.
49
- merge(config_file_options).
50
- merge(slop_options.to_h),
51
- ).run_release
45
+ RungerReleaseAssistant.new(slop_options.to_h).run_release
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '4.1.1'
5
+ VERSION = '4.2.1'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -53,8 +53,14 @@ class RungerReleaseAssistant
53
53
  end
54
54
  end
55
55
 
56
- def initialize(options = {}) # rubocop:disable Style/OptionHash
57
- @options = options
56
+ def initialize(cli_options = {})
57
+ config_file_options = RungerReleaseAssistant::ConfigFileReader.new.options_hash
58
+
59
+ @options =
60
+ DEFAULT_OPTIONS.
61
+ merge(config_file_options).
62
+ merge(cli_options)
63
+
58
64
  logger.debug("Running release with options #{@options}")
59
65
  end
60
66
 
@@ -92,6 +98,10 @@ class RungerReleaseAssistant
92
98
  run_post_release_command
93
99
  end
94
100
 
101
+ def tag_prefix
102
+ @options[:tag_prefix]
103
+ end
104
+
95
105
  private
96
106
 
97
107
  def ensure_on_main_branch
@@ -102,8 +112,17 @@ class RungerReleaseAssistant
102
112
 
103
113
  def print_release_info
104
114
  logger.info("You are running the release process with options #{@options.to_h}.")
105
- logger.info("Current released version is #{(current_released_version || '[none]').blue}.")
106
- logger.info("Next version will be #{next_version.green}.")
115
+
116
+ logger.info(<<~INFO.squish)
117
+ Current released version is
118
+ #{(current_released_version || '[none]').blue}
119
+ (tag: #{latest_tag.yellow}).
120
+ INFO
121
+
122
+ logger.info(<<~INFO.squish)
123
+ Next version will be #{next_version.green}
124
+ (tag: #{next_git_tag.yellow}).
125
+ INFO
107
126
 
108
127
  print_changelog_content_of_upcoming_release
109
128
 
@@ -180,11 +199,16 @@ class RungerReleaseAssistant
180
199
  end
181
200
 
182
201
  def create_tag
183
- execute_command(%(git tag -a '#{git_tag(next_version)}' -m 'Version #{next_version}'))
202
+ execute_command(%(git tag -a '#{next_git_tag}' -m 'Version #{next_version}'))
203
+ end
204
+
205
+ memo_wise \
206
+ def next_git_tag
207
+ git_tag(next_version)
184
208
  end
185
209
 
186
210
  def git_tag(version)
187
- "#{@options[:tag_prefix]}v#{version}"
211
+ "#{tag_prefix}v#{version}"
188
212
  end
189
213
 
190
214
  def push_to_rubygems_and_or_git
@@ -251,8 +275,8 @@ class RungerReleaseAssistant
251
275
  execute_command("git reset --hard origin/#{primary_branch}")
252
276
  end
253
277
 
254
- if execute_command("git rev-parse v#{next_version}", raise_error: false)
255
- execute_command("git tag -d v#{next_version}")
278
+ if execute_command("git rev-parse #{next_git_tag}", raise_error: false)
279
+ execute_command("git tag -d #{next_git_tag}")
256
280
  end
257
281
 
258
282
  if !execute_command('git diff --exit-code', raise_error: false)
@@ -303,7 +327,7 @@ class RungerReleaseAssistant
303
327
 
304
328
  memo_wise \
305
329
  def latest_tag
306
- `git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1`.rstrip
330
+ `git tag -l '#{tag_prefix}v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1`.rstrip
307
331
  end
308
332
 
309
333
  memo_wise \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_release_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger