runger_release_assistant 0.6.0 → 0.7.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: 683ba9baeb33557cc9cbae2d1edc4655ad63cec9593ecd01377fa873e0c93e02
4
- data.tar.gz: 68230ece4069fa2abc218cc898f8ef338c6665929ec36450f2ae45865f5a605a
3
+ metadata.gz: 64d0029dfd4664143185e70ebb80b838eb629e189e75fb51329b630a28235b9b
4
+ data.tar.gz: 7205aa49c63be1b60af0e9290a40509ae81e94bff0068538f0ce7f8124153cd3
5
5
  SHA512:
6
- metadata.gz: cf8976e578a6ab9062360d1cd0ffd34c47a7224cdbfbe893af63ea2d7e2ccca177e7331ea723af0a630de9dde47f612aa3e54521d38e8046020994008be545bd
7
- data.tar.gz: b5badb53127796d8457bd441fd99b6ab6730d446e0d6194005759198e08ac10bfed3d2504b12845954fc213ad84625ee4979da6ee62b17e4c8c0a6425723530a
6
+ metadata.gz: b79cc46effa29a537c0f3b03f06173ee14e9f23b92413fd82d2189ccea24c3e280749643c6d82db5e7d993c7af5d4ea0f2271fa59e4cf0d8572a24f5d1631b41
7
+ data.tar.gz: 79256d4cca7ee5f90e2fc5b3941231bcb9d4f3429c7a630c1389b7706a94e50e39426884fa6a6500cf121acd31a0cf7ef5a085d3471f690026dcc44d41e0acef
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.3.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v0.7.0 (2024-06-15)
2
+ - Look for and use any of several common primary branch names (`main`, `master`, or `trunk`)
3
+
1
4
  ## v0.6.0 (2024-02-02)
2
5
  - Source Ruby version from `.ruby-version` file
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- runger_release_assistant (0.6.0)
4
+ runger_release_assistant (0.7.0)
5
5
  activesupport (>= 6, < 8)
6
6
  memo_wise (>= 1.7, < 2)
7
7
  rainbow (>= 3.0, < 4)
@@ -10,7 +10,7 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.1.3)
13
+ activesupport (7.1.3.3)
14
14
  base64
15
15
  bigdecimal
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -22,51 +22,52 @@ GEM
22
22
  tzinfo (~> 2.0)
23
23
  ast (2.4.2)
24
24
  base64 (0.2.0)
25
- bigdecimal (3.1.5)
25
+ bigdecimal (3.1.8)
26
26
  byebug (11.1.3)
27
27
  coderay (1.1.3)
28
28
  concurrent-ruby (1.2.3)
29
29
  connection_pool (2.4.1)
30
- diff-lcs (1.5.0)
31
- drb (2.2.0)
32
- ruby2_keywords
33
- i18n (1.14.1)
30
+ diff-lcs (1.5.1)
31
+ drb (2.2.1)
32
+ i18n (1.14.5)
34
33
  concurrent-ruby (~> 1.0)
35
- json (2.7.1)
34
+ json (2.7.2)
36
35
  language_server-protocol (3.17.0.3)
37
36
  memo_wise (1.8.0)
38
37
  method_source (1.0.0)
39
- minitest (5.21.1)
38
+ minitest (5.23.0)
40
39
  mutex_m (0.2.0)
41
40
  parallel (1.24.0)
42
- parser (3.3.0.5)
41
+ parser (3.3.1.0)
43
42
  ast (~> 2.4.1)
44
43
  racc
44
+ prism (0.29.0)
45
45
  pry (0.14.2)
46
46
  coderay (~> 1.1)
47
47
  method_source (~> 1.0)
48
48
  pry-byebug (3.10.1)
49
49
  byebug (~> 11.0)
50
50
  pry (>= 0.13, < 0.15)
51
- racc (1.7.3)
51
+ racc (1.8.0)
52
52
  rainbow (3.1.1)
53
- rake (13.1.0)
54
- regexp_parser (2.9.0)
55
- rexml (3.2.6)
56
- rspec (3.12.0)
57
- rspec-core (~> 3.12.0)
58
- rspec-expectations (~> 3.12.0)
59
- rspec-mocks (~> 3.12.0)
60
- rspec-core (3.12.0)
61
- rspec-support (~> 3.12.0)
62
- rspec-expectations (3.12.0)
53
+ rake (13.2.1)
54
+ regexp_parser (2.9.2)
55
+ rexml (3.2.8)
56
+ strscan (>= 3.0.9)
57
+ rspec (3.13.0)
58
+ rspec-core (~> 3.13.0)
59
+ rspec-expectations (~> 3.13.0)
60
+ rspec-mocks (~> 3.13.0)
61
+ rspec-core (3.13.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-expectations (3.13.0)
63
64
  diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.12.0)
65
- rspec-mocks (3.12.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-mocks (3.13.0)
66
67
  diff-lcs (>= 1.2.0, < 2.0)
67
- rspec-support (~> 3.12.0)
68
- rspec-support (3.12.0)
69
- rubocop (1.60.2)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-support (3.13.0)
70
+ rubocop (1.64.0)
70
71
  json (~> 2.3)
71
72
  language_server-protocol (>= 3.17.0)
72
73
  parallel (~> 1.10)
@@ -74,27 +75,31 @@ GEM
74
75
  rainbow (>= 2.2.2, < 4.0)
75
76
  regexp_parser (>= 1.8, < 3.0)
76
77
  rexml (>= 3.2.5, < 4.0)
77
- rubocop-ast (>= 1.30.0, < 2.0)
78
+ rubocop-ast (>= 1.31.1, < 2.0)
78
79
  ruby-progressbar (~> 1.7)
79
80
  unicode-display_width (>= 2.4.0, < 3.0)
80
- rubocop-ast (1.30.0)
81
- parser (>= 3.2.1.0)
81
+ rubocop-ast (1.31.3)
82
+ parser (>= 3.3.1.0)
82
83
  rubocop-capybara (2.20.0)
83
84
  rubocop (~> 1.41)
84
85
  rubocop-factory_bot (2.25.1)
85
86
  rubocop (~> 1.41)
86
- rubocop-performance (1.20.2)
87
+ rubocop-performance (1.21.0)
87
88
  rubocop (>= 1.48.1, < 2.0)
88
- rubocop-ast (>= 1.30.0, < 2.0)
89
- rubocop-rspec (2.26.1)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
90
+ rubocop-rspec (2.29.2)
90
91
  rubocop (~> 1.40)
91
92
  rubocop-capybara (~> 2.17)
92
93
  rubocop-factory_bot (~> 2.22)
94
+ rubocop-rspec_rails (~> 2.28)
95
+ rubocop-rspec_rails (2.28.3)
96
+ rubocop (~> 1.40)
93
97
  ruby-progressbar (1.13.0)
94
- ruby2_keywords (0.0.5)
95
- runger_style (0.6.0)
98
+ runger_style (2.4.0)
99
+ prism (>= 0.24.0)
96
100
  rubocop (>= 1.38.0, < 2)
97
101
  slop (4.10.1)
102
+ strscan (3.1.0)
98
103
  tzinfo (2.0.6)
99
104
  concurrent-ruby (~> 1.0)
100
105
  unicode-display_width (2.5.0)
@@ -115,7 +120,7 @@ DEPENDENCIES
115
120
  runger_style
116
121
 
117
122
  RUBY VERSION
118
- ruby 3.3.0p0
123
+ ruby 3.3.3p89
119
124
 
120
125
  BUNDLED WITH
121
- 2.5.5
126
+ 2.5.11
data/bin/_guard-core CHANGED
@@ -17,8 +17,8 @@ if File.file?(bundle_binstub)
17
17
  if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
18
18
  load(bundle_binstub)
19
19
  else
20
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
20
+ abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.')
22
22
  end
23
23
  end
24
24
 
data/bin/guard CHANGED
@@ -17,8 +17,8 @@ if File.file?(bundle_binstub)
17
17
  if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
18
18
  load(bundle_binstub)
19
19
  else
20
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
20
+ abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.')
22
22
  end
23
23
  end
24
24
 
data/bin/rspec CHANGED
@@ -17,8 +17,8 @@ if File.file?(bundle_binstub)
17
17
  if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
18
18
  load(bundle_binstub)
19
19
  else
20
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
20
+ abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.')
22
22
  end
23
23
  end
24
24
 
data/bin/rubocop CHANGED
@@ -17,8 +17,8 @@ if File.file?(bundle_binstub)
17
17
  if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
18
18
  load(bundle_binstub)
19
19
  else
20
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
20
+ abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
21
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.')
22
22
  end
23
23
  end
24
24
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class RungerReleaseAssistant
5
- VERSION = '0.6.0'
5
+ VERSION = '0.7.0'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
@@ -19,6 +19,16 @@ Dir["#{File.dirname(__FILE__)}/runger_release_assistant/**/*.rb"].each { |file|
19
19
  class RungerReleaseAssistant
20
20
  prepend MemoWise
21
21
 
22
+ class UnknownPrimaryBranch < StandardError
23
+ DEFAULT_MESSAGE = <<~MESSAGE.squish
24
+ Failed to automatically determine primary branch. Specify it via the `primary_branch` option.
25
+ MESSAGE
26
+
27
+ def initialize(message = DEFAULT_MESSAGE)
28
+ super
29
+ end
30
+ end
31
+
22
32
  DEFAULT_OPTIONS = { git: true, rubygems: false }.freeze
23
33
 
24
34
  class << self
@@ -114,12 +124,19 @@ class RungerReleaseAssistant
114
124
  end
115
125
 
116
126
  def switch_to_main
117
- execute_command("git checkout #{main_branch}")
127
+ execute_command("git checkout #{primary_branch}")
128
+ end
129
+
130
+ memo_wise \
131
+ def primary_branch
132
+ @options[:primary_branch] ||
133
+ common_primary_branch_name ||
134
+ (raise(UnknownPrimaryBranch))
118
135
  end
119
136
 
120
137
  memo_wise \
121
- def main_branch
122
- @options[:primary_branch] || 'master'
138
+ def common_primary_branch_name
139
+ `git branch`.scan(/ (main|master|trunk)$/).dig(0, 0)
123
140
  end
124
141
 
125
142
  def update_changelog_for_release
@@ -193,8 +210,8 @@ class RungerReleaseAssistant
193
210
  end
194
211
 
195
212
  def restore_and_abort(exit_code:)
196
- if current_branch == main_branch
197
- execute_command("git reset --hard origin/#{main_branch}")
213
+ if current_branch == primary_branch
214
+ execute_command("git reset --hard origin/#{primary_branch}")
198
215
  end
199
216
 
200
217
  if execute_command("git rev-parse v#{next_version}", raise_error: false)
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec|
39
39
  spec.add_dependency('rainbow', '>= 3.0', '< 4')
40
40
  spec.add_dependency('slop', '~> 4.8')
41
41
 
42
- spec.required_ruby_version = Gem::Requirement.new(">= #{File.read('.ruby-version').rstrip}")
42
+ spec.required_ruby_version = ">= #{File.read('.ruby-version').rstrip}"
43
43
  end
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.6.0
4
+ version: 0.7.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-02-03 00:00:00.000000000 Z
11
+ date: 2024-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -134,14 +134,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: 3.3.0
137
+ version: 3.3.3
138
138
  required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  requirements: []
144
- rubygems_version: 3.5.3
144
+ rubygems_version: 3.5.11
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: A gem / CLI tool to automate the release process of other gems