runger_release_assistant 0.9.0 → 0.10.0

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: b0c99d3dec5f2bdd4c9568d3ce6326371cf08d7f7ddde0f0237f6122fdef768a
4
- data.tar.gz: d01f8b764551671d3db86dadc41216aac3c0a89275a25f2b273a327607f88d0f
3
+ metadata.gz: 4f602de5188864bef60835e784830100b08349a1719e1d96ccd71a3e76871b3c
4
+ data.tar.gz: 103c5b3b87636d53f4dc9f8872feee81449e498ded6c190716776c0e007d9918
5
5
  SHA512:
6
- metadata.gz: 76746bae3f96fee9498b4e31547ca9ca414c2b1f9a957ab45b9075128eddba960f7d12a3506575f2c32416f7b7ae6b4eebb4ba69b601bc384f5805f924d28bcc
7
- data.tar.gz: 8d6f05637af0a6dbe3e805b849a46e4c030906f3b0a26e7c234c35fc45907dd257856eae241f52d9ad3f14697eeb7ab6eb2f20054b99c6b4896f4827aa744e95
6
+ metadata.gz: 70d1914de0407029e273495d797330164fab880f53e113734475410c0bbe82625b318b1b52544eb4ab028443324fe8019ef8653855775aa66a0ae1ba4813d9a6
7
+ data.tar.gz: b0cbe79c7c6255012d517289c16d14a07a20e24711f6679a8560b17a3c71e8ad1d6c86d1ec57631a15c809ef33ea821ca4f584b500210fc8e9ac2aefe3a2d1b7
@@ -1,9 +1,12 @@
1
+ ---
1
2
  version: 2
2
3
  updates:
3
- - package-ecosystem: bundler
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "04:04"
8
- timezone: America/Chicago
9
- open-pull-requests-limit: 20
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ time: "04:04"
9
+ timezone: America/Chicago
10
+ open-pull-requests-limit: 20
11
+ allow:
12
+ - dependency-type: all
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.3
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## v0.10.0 (2024-07-12)
2
+ - Don't require enter key when confirming release
3
+ - Print currently released version when confirming release
4
+ - Print changelog and diff when confirming release
5
+
6
+ ### Internal
7
+ - Bump Ruby from 3.3.3 to 3.3.4
8
+ - Update gems
9
+ - Run Gitleaks, ShellCheck, and RuboCop in pre-push hook
10
+
1
11
  ## v0.9.0 (2024-06-28)
2
12
  - Enforce only major and minor parts of required Ruby version (loosening the required Ruby version from 3.3.3 to 3.3.0)
3
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- runger_release_assistant (0.9.0)
4
+ runger_release_assistant (0.10.0)
5
5
  activesupport (>= 6, < 8)
6
6
  memo_wise (>= 1.7, < 2)
7
7
  rainbow (>= 3.0, < 4)
@@ -35,10 +35,10 @@ GEM
35
35
  language_server-protocol (3.17.0.3)
36
36
  memo_wise (1.9.0)
37
37
  method_source (1.1.0)
38
- minitest (5.24.0)
38
+ minitest (5.24.1)
39
39
  mutex_m (0.2.0)
40
40
  parallel (1.25.1)
41
- parser (3.3.3.0)
41
+ parser (3.3.4.0)
42
42
  ast (~> 2.4.1)
43
43
  racc
44
44
  prism (0.30.0)
@@ -67,13 +67,13 @@ GEM
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
68
  rspec-support (~> 3.13.0)
69
69
  rspec-support (3.13.1)
70
- rubocop (1.64.1)
70
+ rubocop (1.65.0)
71
71
  json (~> 2.3)
72
72
  language_server-protocol (>= 3.17.0)
73
73
  parallel (~> 1.10)
74
74
  parser (>= 3.3.0.2)
75
75
  rainbow (>= 2.2.2, < 4.0)
76
- regexp_parser (>= 1.8, < 3.0)
76
+ regexp_parser (>= 2.4, < 3.0)
77
77
  rexml (>= 3.2.5, < 4.0)
78
78
  rubocop-ast (>= 1.31.1, < 2.0)
79
79
  ruby-progressbar (~> 1.7)
@@ -83,10 +83,10 @@ GEM
83
83
  rubocop-performance (1.21.1)
84
84
  rubocop (>= 1.48.1, < 2.0)
85
85
  rubocop-ast (>= 1.31.1, < 2.0)
86
- rubocop-rspec (3.0.1)
86
+ rubocop-rspec (3.0.3)
87
87
  rubocop (~> 1.61)
88
88
  ruby-progressbar (1.13.0)
89
- runger_style (2.8.0)
89
+ runger_style (2.12.0)
90
90
  prism (>= 0.24.0)
91
91
  rubocop (>= 1.38.0, < 2)
92
92
  slop (4.10.1)
@@ -111,7 +111,7 @@ DEPENDENCIES
111
111
  runger_style
112
112
 
113
113
  RUBY VERSION
114
- ruby 3.3.3p89
114
+ ruby 3.3.4p94
115
115
 
116
116
  BUNDLED WITH
117
117
  2.5.11
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail # exit on any error, don't allow undefined variables, pipes don't swallow errors
4
+
5
+ lint gitleaks
6
+
7
+ background-and-notify lint rubocop
8
+ background-and-notify lint shellcheck
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '0.9.0'
5
+ VERSION = '0.10.0'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -1,12 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/all'
4
+ require 'io/console'
4
5
  require 'memo_wise'
5
6
  require 'rainbow/refinement'
6
7
  require 'slop'
7
8
  require 'yaml'
8
9
 
10
+ module StringWithPipe
11
+ refine String do
12
+ def pipe(command)
13
+ IO.popen(command, 'r+') do |io|
14
+ io.puts(self)
15
+ io.close_write
16
+ io.read
17
+ end
18
+ end
19
+ end
20
+ end
21
+
9
22
  using Rainbow
23
+ using StringWithPipe
10
24
 
11
25
  # We need to define the class before requiring the modules.
12
26
  # rubocop:disable Lint/EmptyClass
@@ -57,8 +71,8 @@ class RungerReleaseAssistant
57
71
  end
58
72
 
59
73
  def run_release
60
- print_release_plan
61
- confirm_release_plan
74
+ print_release_info
75
+ confirm_release_looks_good
62
76
  verify_repository_cleanliness
63
77
  remember_initial_branch
64
78
  switch_to_main
@@ -94,19 +108,29 @@ class RungerReleaseAssistant
94
108
  end
95
109
  end
96
110
 
97
- def print_release_plan
98
- logger.info("You are running the release process with options #{@options.to_h}!")
99
- logger.info("Current version is #{current_version}")
100
- logger.info("Next version will be #{next_version}")
111
+ def print_release_info
112
+ logger.info("You are running the release process with options #{@options.to_h}.")
113
+ logger.info("Current released version is #{current_released_version.blue}.")
114
+ logger.info("Current alpha version is #{current_version.yellow}.")
115
+ logger.info("Next version will be #{next_version.green}.")
116
+
117
+ print_changelog_content_of_upcoming_release
118
+
119
+ print_diff_since_last_release
101
120
  end
102
121
 
103
- def confirm_release_plan
122
+ def confirm_release_looks_good
104
123
  logger.info('Does that look good? [y]n')
105
- response = $stdin.gets.chomp
106
124
 
107
- if response.downcase == 'n' # rubocop:disable Performance/Casecmp
125
+ case $stdin.getch
126
+ when 'n', "\u0003"
108
127
  logger.info('Okay, aborting.')
109
128
  restore_and_abort(exit_code: 0)
129
+ when 'y', "\r"
130
+ # (proceed)
131
+ else
132
+ logger.info("That's not an option.")
133
+ confirm_release_looks_good
110
134
  end
111
135
  end
112
136
 
@@ -177,7 +201,11 @@ class RungerReleaseAssistant
177
201
  end
178
202
 
179
203
  def create_tag
180
- execute_command(%(git tag -m "Version #{next_version}" v#{next_version}))
204
+ execute_command(%(git tag -m 'Version #{next_version}' '#{git_tag_version(next_version)}'))
205
+ end
206
+
207
+ def git_tag_version(version)
208
+ "v#{version}"
181
209
  end
182
210
 
183
211
  def push_to_git
@@ -226,6 +254,23 @@ class RungerReleaseAssistant
226
254
  exit(exit_code)
227
255
  end
228
256
 
257
+ def print_changelog_content_of_upcoming_release
258
+ logger.info('Changelog content for this upcoming release:')
259
+ File.read(changelog_path)[/\A## Unreleased\n(?:(?!\n## ).)+/m].
260
+ pipe('bat --color always --language markdown --style grid,numbers').
261
+ then { puts(_1) }
262
+ end
263
+
264
+ def print_diff_since_last_release
265
+ logger.info('Diff since the last release:')
266
+ system(
267
+ { 'DELTA_PAGER' => 'cat' },
268
+ 'git',
269
+ 'diff',
270
+ "#{git_tag_version(current_released_version)}...",
271
+ )
272
+ end
273
+
229
274
  def file_path(file_name)
230
275
  system_output("find . -type f -name #{file_name}").delete_prefix('./')
231
276
  end
@@ -248,6 +293,11 @@ class RungerReleaseAssistant
248
293
  file_path('CHANGELOG.md')
249
294
  end
250
295
 
296
+ memo_wise \
297
+ def current_released_version
298
+ `git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1`.delete_prefix('v').rstrip
299
+ end
300
+
251
301
  memo_wise \
252
302
  def current_version
253
303
  file_contents(version_file_path).match(/VERSION += +['"](?<version>.*)['"]/)&.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_release_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-29 00:00:00.000000000 Z
11
+ date: 2024-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,7 @@ files:
108
108
  - Rakefile
109
109
  - bin/_guard-core
110
110
  - bin/console
111
+ - bin/githooks/pre-push
111
112
  - bin/guard
112
113
  - bin/release
113
114
  - bin/rspec
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubygems_version: 3.5.14
146
+ rubygems_version: 3.5.15
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: A gem / CLI tool to automate the release process of other gems