runger_release_assistant 0.10.0 → 0.12.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: 4f602de5188864bef60835e784830100b08349a1719e1d96ccd71a3e76871b3c
4
- data.tar.gz: 103c5b3b87636d53f4dc9f8872feee81449e498ded6c190716776c0e007d9918
3
+ metadata.gz: 1a867825a53270a27fb95f855c131713fba626a52806b533be6ccca145e5b3ab
4
+ data.tar.gz: 29c146f08cad1bfe765f1110c832a56998629a8f657d34c21f7b82c594d7a17a
5
5
  SHA512:
6
- metadata.gz: 70d1914de0407029e273495d797330164fab880f53e113734475410c0bbe82625b318b1b52544eb4ab028443324fe8019ef8653855775aa66a0ae1ba4813d9a6
7
- data.tar.gz: b0cbe79c7c6255012d517289c16d14a07a20e24711f6679a8560b17a3c71e8ad1d6c86d1ec57631a15c809ef33ea821ca4f584b500210fc8e9ac2aefe3a2d1b7
6
+ metadata.gz: 97bf886cdc4c42fdb09374205580f6b18a8ab332d0c7463e2847ec4a78440867881690b0cfff192f01edb97bdb95cd0256df7d86da764d3be72a8ec4715a3dd3
7
+ data.tar.gz: 91187271f5c949ba680a42cae88dc4f7dd4c049bfb1117d4ba99d89b577b4a5d233957570975485e8e7dbee8a2ce6832e92d0be00b3652967992d0cc836b0344
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.12.0 (2024-07-28)
2
+ - Execute `safe` command outside of Gemfile context
3
+
4
+ ## v0.11.0 (2024-07-23)
5
+ - Run 'safe' command (if one exists) after releasing
6
+
1
7
  ## v0.10.0 (2024-07-12)
2
8
  - Don't require enter key when confirming release
3
9
  - Print currently released version when confirming release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- runger_release_assistant (0.10.0)
4
+ runger_release_assistant (0.12.0)
5
5
  activesupport (>= 6, < 8)
6
6
  memo_wise (>= 1.7, < 2)
7
7
  rainbow (>= 3.0, < 4)
@@ -52,7 +52,7 @@ GEM
52
52
  rainbow (3.1.1)
53
53
  rake (13.2.1)
54
54
  regexp_parser (2.9.2)
55
- rexml (3.3.1)
55
+ rexml (3.3.2)
56
56
  strscan
57
57
  rspec (3.13.0)
58
58
  rspec-core (~> 3.13.0)
@@ -86,7 +86,7 @@ GEM
86
86
  rubocop-rspec (3.0.3)
87
87
  rubocop (~> 1.61)
88
88
  ruby-progressbar (1.13.0)
89
- runger_style (2.12.0)
89
+ runger_style (2.13.0)
90
90
  prism (>= 0.24.0)
91
91
  rubocop (>= 1.38.0, < 2)
92
92
  slop (4.10.1)
data/README.md CHANGED
@@ -2,27 +2,46 @@
2
2
 
3
3
  # `runger_release_assistant`
4
4
 
5
- This is a CLI tool that helps to automate the process of releasing new versions of a gem via
6
- git/GitHub and (optionally) via RubyGems.
5
+ This is a CLI tool that I (David Runger) use to automate the release of new gem
6
+ versions via git/GitHub and (optionally) via RubyGems.
7
+
8
+ **I do not recommend this gem for general use.**
7
9
 
8
10
  <!--ts-->
9
- * [runger_release_assistant](#runger_release_assistant)
10
- * [Dependencies](#dependencies)
11
- * [Installation](#installation)
12
- * [Global installation](#global-installation)
13
- * [Installation in a specific project](#installation-in-a-specific-project)
14
- * [Create a binstub](#create-a-binstub)
15
- * [Basic usage](#basic-usage)
16
- * [Available options and examples](#available-options-and-examples)
17
- * [Using with RubyGems](#using-with-rubygems)
18
- * [Development](#development)
19
- * [Contributing](#contributing)
20
- * [License](#license)
21
-
22
- <!-- Added by: david, at: Mon Feb 1 20:16:03 PST 2021 -->
11
+ * [runger_release_assistant](#runger_release_assistant)
12
+ * [Not recommended for general use!](#not-recommended-for-general-use)
13
+ * [Dependencies](#dependencies)
14
+ * [Installation](#installation)
15
+ * [Global installation](#global-installation)
16
+ * [Installation in a specific project](#installation-in-a-specific-project)
17
+ * [Create a binstub](#create-a-binstub)
18
+ * [Basic usage](#basic-usage)
19
+ * [Available options and examples](#available-options-and-examples)
20
+ * [Config](#config)
21
+ * [Using with RubyGems](#using-with-rubygems)
22
+ * [Development](#development)
23
+ * [Contributing](#contributing)
24
+ * [License](#license)
25
+
26
+ <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
27
+ <!-- Added by: david, at: Tue Jul 23 12:46:01 AM CDT 2024 -->
23
28
 
24
29
  <!--te-->
25
30
 
31
+ ## Not recommended for general use!
32
+
33
+ This gem is somewhat customized and built specifically for my (David Runger's)
34
+ custom and idiosyncratic workflow. For example, after releasing, this gem will
35
+ automatically execute a `safe` command, if one is present on the machine. You
36
+ might not want this behavior (if you have a `safe` command that you _don't_ want
37
+ to be invoked after a release).
38
+
39
+ Realistically speaking, though, this gem actually probably could be used by
40
+ anyone, since most of this gem's functionality actually is built in a
41
+ generalized way that I think won't conflict with most other people's workflows,
42
+ but, still, I'm guessing that there are other, better tools available, anyway,
43
+ and, so, on net, I just wouldn't recommend that others use this gem.
44
+
26
45
  ## Dependencies
27
46
 
28
47
  This gem assumes that you have `git` installed.
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '0.10.0'
5
+ VERSION = '0.12.0'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -97,6 +97,7 @@ class RungerReleaseAssistant
97
97
  ERROR_LOG
98
98
  restore_and_abort(exit_code: 1)
99
99
  else
100
+ run_safe_command
100
101
  switch_to_initial_branch
101
102
  end
102
103
 
@@ -220,6 +221,12 @@ class RungerReleaseAssistant
220
221
  execute_command('bundle exec rake release', show_system_output: true)
221
222
  end
222
223
 
224
+ def run_safe_command
225
+ if system('which safe')
226
+ execute_command('safe', clear_bundler_context: true)
227
+ end
228
+ end
229
+
223
230
  def switch_to_initial_branch
224
231
  execute_command("git checkout #{@initial_branch}") if @initial_branch
225
232
  end
@@ -228,13 +235,29 @@ class RungerReleaseAssistant
228
235
  `#{command}`.rstrip
229
236
  end
230
237
 
231
- def execute_command(command, raise_error: true, show_system_output: false)
238
+ def execute_command(
239
+ command,
240
+ raise_error: true,
241
+ show_system_output: false,
242
+ clear_bundler_context: false
243
+ )
232
244
  logger.debug("Running system command `#{command}`")
233
- if @options[:show_system_output] || show_system_output
234
- system(command, exception: raise_error)
235
- else
236
- system(command, exception: raise_error, out: File::NULL, err: File::NULL)
237
- end
245
+
246
+ env =
247
+ if clear_bundler_context
248
+ ENV.keys.grep(/\A(BUNDLE|RUBY)/).to_h { [_1, nil] }
249
+ else
250
+ {}
251
+ end
252
+
253
+ kwargs =
254
+ if @options[:show_system_output] || show_system_output
255
+ {}
256
+ else
257
+ { out: File::NULL, err: File::NULL }
258
+ end
259
+
260
+ system(env, command, exception: raise_error, **kwargs)
238
261
  end
239
262
 
240
263
  def restore_and_abort(exit_code:)
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.10.0
4
+ version: 0.12.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-07-12 00:00:00.000000000 Z
11
+ date: 2024-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.5.15
146
+ rubygems_version: 3.5.16
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: A gem / CLI tool to automate the release process of other gems