runger_release_assistant 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57a5f8b4ebd611aca8f1fa84536415a3fe51698c2bf681b8a834b68c3d63c2fa
4
- data.tar.gz: 15a3b51bd84f7bb39c18ec17a04069f397bc7412a98341ec5c7267584319253a
3
+ metadata.gz: 64d0029dfd4664143185e70ebb80b838eb629e189e75fb51329b630a28235b9b
4
+ data.tar.gz: 7205aa49c63be1b60af0e9290a40509ae81e94bff0068538f0ce7f8124153cd3
5
5
  SHA512:
6
- metadata.gz: 38c132c1924f55f4d9474ad6c93fe455e307829f09374c0d09cb3068496a1e255b0bdbbb4e1308beafda8e2bdf3522146cf936e61f2faa67cafafc124d7c397b
7
- data.tar.gz: 5bfe0472eda9b60548acceec5dd87427e7f33bb0e0bb9ae067c94652511961a5d83ae6946fa286cc0c59740004c1505161c371124ec4257430caf344bd7065b1
6
+ metadata.gz: b79cc46effa29a537c0f3b03f06173ee14e9f23b92413fd82d2189ccea24c3e280749643c6d82db5e7d993c7af5d4ea0f2271fa59e4cf0d8572a24f5d1631b41
7
+ data.tar.gz: 79256d4cca7ee5f90e2fc5b3941231bcb9d4f3429c7a630c1389b7706a94e50e39426884fa6a6500cf121acd31a0cf7ef5a085d3471f690026dcc44d41e0acef
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.7.0 (2024-06-15)
2
+ - Look for and use any of several common primary branch names (`main`, `master`, or `trunk`)
3
+
4
+ ## v0.6.0 (2024-02-02)
5
+ - Source Ruby version from `.ruby-version` file
6
+
1
7
  ## v0.5.0 (2023-06-20)
2
8
  ### Changed
3
9
  - Switch from `colorize` to `rainbow` for colored terminal printing
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ruby File.read('.ruby-version').rstrip
3
+ ruby file: '.ruby-version'
4
+
4
5
  source 'https://rubygems.org'
5
6
 
6
7
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- runger_release_assistant (0.5.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,80 +10,99 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.5)
13
+ activesupport (7.1.3.3)
14
+ base64
15
+ bigdecimal
14
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ connection_pool (>= 2.2.5)
18
+ drb
15
19
  i18n (>= 1.6, < 2)
16
20
  minitest (>= 5.1)
21
+ mutex_m
17
22
  tzinfo (~> 2.0)
18
23
  ast (2.4.2)
24
+ base64 (0.2.0)
25
+ bigdecimal (3.1.8)
19
26
  byebug (11.1.3)
20
27
  coderay (1.1.3)
21
- concurrent-ruby (1.2.2)
22
- diff-lcs (1.5.0)
23
- i18n (1.13.0)
28
+ concurrent-ruby (1.2.3)
29
+ connection_pool (2.4.1)
30
+ diff-lcs (1.5.1)
31
+ drb (2.2.1)
32
+ i18n (1.14.5)
24
33
  concurrent-ruby (~> 1.0)
25
- json (2.6.3)
26
- memo_wise (1.7.0)
34
+ json (2.7.2)
35
+ language_server-protocol (3.17.0.3)
36
+ memo_wise (1.8.0)
27
37
  method_source (1.0.0)
28
- minitest (5.18.0)
29
- parallel (1.23.0)
30
- parser (3.2.2.3)
38
+ minitest (5.23.0)
39
+ mutex_m (0.2.0)
40
+ parallel (1.24.0)
41
+ parser (3.3.1.0)
31
42
  ast (~> 2.4.1)
32
43
  racc
44
+ prism (0.29.0)
33
45
  pry (0.14.2)
34
46
  coderay (~> 1.1)
35
47
  method_source (~> 1.0)
36
48
  pry-byebug (3.10.1)
37
49
  byebug (~> 11.0)
38
50
  pry (>= 0.13, < 0.15)
39
- racc (1.7.0)
51
+ racc (1.8.0)
40
52
  rainbow (3.1.1)
41
- rake (13.0.6)
42
- regexp_parser (2.8.1)
43
- rexml (3.2.5)
44
- rspec (3.12.0)
45
- rspec-core (~> 3.12.0)
46
- rspec-expectations (~> 3.12.0)
47
- rspec-mocks (~> 3.12.0)
48
- rspec-core (3.12.0)
49
- rspec-support (~> 3.12.0)
50
- 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)
51
64
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.12.0)
53
- rspec-mocks (3.12.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-mocks (3.13.0)
54
67
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.12.0)
56
- rspec-support (3.12.0)
57
- rubocop (1.52.1)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-support (3.13.0)
70
+ rubocop (1.64.0)
58
71
  json (~> 2.3)
72
+ language_server-protocol (>= 3.17.0)
59
73
  parallel (~> 1.10)
60
- parser (>= 3.2.2.3)
74
+ parser (>= 3.3.0.2)
61
75
  rainbow (>= 2.2.2, < 4.0)
62
76
  regexp_parser (>= 1.8, < 3.0)
63
77
  rexml (>= 3.2.5, < 4.0)
64
- rubocop-ast (>= 1.28.0, < 2.0)
78
+ rubocop-ast (>= 1.31.1, < 2.0)
65
79
  ruby-progressbar (~> 1.7)
66
80
  unicode-display_width (>= 2.4.0, < 3.0)
67
- rubocop-ast (1.29.0)
68
- parser (>= 3.2.1.0)
69
- rubocop-capybara (2.18.0)
81
+ rubocop-ast (1.31.3)
82
+ parser (>= 3.3.1.0)
83
+ rubocop-capybara (2.20.0)
70
84
  rubocop (~> 1.41)
71
- rubocop-factory_bot (2.22.0)
72
- rubocop (~> 1.33)
73
- rubocop-performance (1.18.0)
74
- rubocop (>= 1.7.0, < 2.0)
75
- rubocop-ast (>= 0.4.0)
76
- rubocop-rspec (2.22.0)
77
- rubocop (~> 1.33)
85
+ rubocop-factory_bot (2.25.1)
86
+ rubocop (~> 1.41)
87
+ rubocop-performance (1.21.0)
88
+ rubocop (>= 1.48.1, < 2.0)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
90
+ rubocop-rspec (2.29.2)
91
+ rubocop (~> 1.40)
78
92
  rubocop-capybara (~> 2.17)
79
93
  rubocop-factory_bot (~> 2.22)
94
+ rubocop-rspec_rails (~> 2.28)
95
+ rubocop-rspec_rails (2.28.3)
96
+ rubocop (~> 1.40)
80
97
  ruby-progressbar (1.13.0)
81
- runger_style (0.3.0)
98
+ runger_style (2.4.0)
99
+ prism (>= 0.24.0)
82
100
  rubocop (>= 1.38.0, < 2)
83
101
  slop (4.10.1)
102
+ strscan (3.1.0)
84
103
  tzinfo (2.0.6)
85
104
  concurrent-ruby (~> 1.0)
86
- unicode-display_width (2.4.2)
105
+ unicode-display_width (2.5.0)
87
106
 
88
107
  PLATFORMS
89
108
  ruby
@@ -101,7 +120,7 @@ DEPENDENCIES
101
120
  runger_style
102
121
 
103
122
  RUBY VERSION
104
- ruby 3.2.2p53
123
+ ruby 3.3.3p89
105
124
 
106
125
  BUNDLED WITH
107
- 2.4.13
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.5.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 = '>= 3.2'
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.5.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: 2023-06-20 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.2'
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.4.13
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