kettle-dev 1.0.27 → 1.1.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.simplecov +5 -0
- data/Appraisals +30 -0
- data/CHANGELOG.md +16 -1
- data/Gemfile +3 -0
- data/README.md +27 -9
- data/README.md.example +1 -1
- data/Rakefile.example +1 -1
- data/exe/kettle-dev-setup +302 -0
- data/gemfiles/modular/injected.gemfile +60 -0
- data/kettle-dev.gemspec.example +46 -0
- data/lib/kettle/dev/git_adapter.rb +37 -8
- data/lib/kettle/dev/tasks/install_task.rb +7 -3
- data/lib/kettle/dev/tasks/template_task.rb +11 -5
- data/lib/kettle/dev/template_helpers.rb +42 -13
- data/lib/kettle/dev/version.rb +1 -1
- data/lib/kettle/dev.rb +45 -33
- data/sig/kettle/dev/git_adapter.rbs +7 -6
- data/sig/kettle/dev/tasks.rbs +7 -0
- data/sig/kettle/dev.rbs +1 -0
- data.tar.gz.sig +0 -0
- metadata +29 -20
- metadata.gz.sig +0 -0
data/kettle-dev.gemspec.example
CHANGED
@@ -117,4 +117,50 @@ Gem::Specification.new do |spec|
|
|
117
117
|
|
118
118
|
# Dev, Test, & Release Tasks
|
119
119
|
spec.add_development_dependency("{KETTLE|DEV|GEM}", "~> 1.0") # ruby >= 2.3.0
|
120
|
+
|
121
|
+
# Security
|
122
|
+
spec.add_development_dependency("bundler-audit", "~> 0.9.2") # ruby >= 2.0.0
|
123
|
+
|
124
|
+
# Tasks
|
125
|
+
spec.add_development_dependency("rake", "~> 13.0") # ruby >= 2.2.0
|
126
|
+
|
127
|
+
# Debugging
|
128
|
+
spec.add_development_dependency("require_bench", "~> 1.0", ">= 1.0.4") # ruby >= 2.2.0
|
129
|
+
|
130
|
+
# Testing
|
131
|
+
spec.add_development_dependency("appraisal2", "~> 3.0") # ruby >= 1.8.7, for testing against multiple versions of dependencies
|
132
|
+
spec.add_development_dependency("kettle-test", "~> 1.0") # ruby >= 2.3
|
133
|
+
spec.add_development_dependency("rspec-pending_for") # ruby >= 2.3, used to skip specs on incompatible Rubies
|
134
|
+
|
135
|
+
# Releasing
|
136
|
+
spec.add_development_dependency("ruby-progressbar", "~> 1.13") # ruby >= 0
|
137
|
+
spec.add_development_dependency("stone_checksums", "~> 1.0", ">= 1.0.2") # ruby >= 2.2.0
|
138
|
+
|
139
|
+
# Git integration (optional)
|
140
|
+
# The 'git' gem is optional; kettle-dev falls back to shelling out to `git` if it is not present.
|
141
|
+
# The current release of the git gem depends on activesupport, which makes it too heavy to depend on directly
|
142
|
+
# spec.add_dependency("git", ">= 1.19.1") # ruby >= 2.3
|
143
|
+
|
144
|
+
# Development tasks
|
145
|
+
# The cake is a lie. erb v2.2, the oldest release on RubyGems.org, was never compatible with Ruby 2.3.
|
146
|
+
# This means we have no choice but to use the erb that shipped with Ruby 2.3
|
147
|
+
# /opt/hostedtoolcache/Ruby/2.3.8/x64/lib/ruby/gems/2.3.0/gems/erb-2.2.2/lib/erb.rb:670:in `prepare_trim_mode': undefined method `match?' for "-":String (NoMethodError)
|
148
|
+
# spec.add_development_dependency("erb", ">= 2.2") # ruby >= 2.3.0, not SemVer, old rubies get dropped in a patch.
|
149
|
+
spec.add_development_dependency("gitmoji-regex", "~> 1.0", ">= 1.0.3") # ruby >= 2.3.0
|
150
|
+
|
151
|
+
# HTTP recording for deterministic specs
|
152
|
+
# It seems that somehow just having a newer version of appraisal installed breaks
|
153
|
+
# Ruby 2.3 and 2.4 even if their bundle specifies an older version,
|
154
|
+
# and as a result it can only be a dependency in the appraisals.
|
155
|
+
# | An error occurred while loading spec_helper.
|
156
|
+
# | Failure/Error: require "vcr"
|
157
|
+
# |
|
158
|
+
# | NoMethodError:
|
159
|
+
# | undefined method `delete_prefix' for "CONTENT_LENGTH":String
|
160
|
+
# | # ./spec/config/vcr.rb:3:in `require'
|
161
|
+
# | # ./spec/config/vcr.rb:3:in `<top (required)>'
|
162
|
+
# | # ./spec/spec_helper.rb:8:in `require_relative'
|
163
|
+
# | # ./spec/spec_helper.rb:8:in `<top (required)>'
|
164
|
+
# spec.add_development_dependency("vcr", ">= 4") # 6.0 claims to support ruby >= 2.3, but fails on ruby 2.4
|
165
|
+
# spec.add_development_dependency("webmock", ">= 3") # Last version to support ruby >= 2.3
|
120
166
|
end
|
@@ -15,6 +15,27 @@ module Kettle
|
|
15
15
|
#
|
16
16
|
# Public API is intentionally small and only includes what we need right now.
|
17
17
|
class GitAdapter
|
18
|
+
# Determine whether the working tree is clean (no unstaged, staged, or untracked changes).
|
19
|
+
# @return [Boolean] true if clean, false if any changes or on error
|
20
|
+
def clean?
|
21
|
+
if @backend == :gem
|
22
|
+
begin
|
23
|
+
status = @git.status
|
24
|
+
# git gem's Status responds to changed, added, deleted, untracked, etc.
|
25
|
+
status.changed.empty? && status.added.empty? && status.deleted.empty? && status.untracked.empty?
|
26
|
+
rescue StandardError => e
|
27
|
+
Kettle::Dev.debug_error(e, __method__)
|
28
|
+
false
|
29
|
+
end
|
30
|
+
else
|
31
|
+
out, st = Open3.capture2("git", "status", "--porcelain")
|
32
|
+
st.success? && out.strip.empty?
|
33
|
+
end
|
34
|
+
rescue StandardError => e
|
35
|
+
Kettle::Dev.debug_error(e, __method__)
|
36
|
+
false
|
37
|
+
end
|
38
|
+
|
18
39
|
# Execute a git command and capture its stdout and success flag.
|
19
40
|
# This is a generic escape hatch used by higher-level code for read-only
|
20
41
|
# queries that aren't covered by the explicit adapter API. Tests can stub
|
@@ -24,7 +45,8 @@ module Kettle
|
|
24
45
|
def capture(args)
|
25
46
|
out, status = Open3.capture2("git", *args)
|
26
47
|
[out.strip, status.success?]
|
27
|
-
rescue StandardError
|
48
|
+
rescue StandardError => e
|
49
|
+
Kettle::Dev.debug_error(e, __method__)
|
28
50
|
["", false]
|
29
51
|
end
|
30
52
|
|
@@ -44,7 +66,8 @@ module Kettle
|
|
44
66
|
@backend = :gem
|
45
67
|
@git = ::Git.open(Dir.pwd)
|
46
68
|
end
|
47
|
-
rescue LoadError
|
69
|
+
rescue LoadError => e
|
70
|
+
Kettle::Dev.debug_error(e, __method__)
|
48
71
|
# Optional dependency: fall back to CLI
|
49
72
|
@backend = :cli
|
50
73
|
rescue StandardError => e
|
@@ -67,7 +90,8 @@ module Kettle
|
|
67
90
|
@git.push(nil, branch, force: force)
|
68
91
|
end
|
69
92
|
true
|
70
|
-
rescue StandardError
|
93
|
+
rescue StandardError => e
|
94
|
+
Kettle::Dev.debug_error(e, __method__)
|
71
95
|
false
|
72
96
|
end
|
73
97
|
else
|
@@ -88,7 +112,8 @@ module Kettle
|
|
88
112
|
out, status = Open3.capture2("git", "rev-parse", "--abbrev-ref", "HEAD")
|
89
113
|
status.success? ? out.strip : nil
|
90
114
|
end
|
91
|
-
rescue StandardError
|
115
|
+
rescue StandardError => e
|
116
|
+
Kettle::Dev.debug_error(e, __method__)
|
92
117
|
nil
|
93
118
|
end
|
94
119
|
|
@@ -100,7 +125,8 @@ module Kettle
|
|
100
125
|
out, status = Open3.capture2("git", "remote")
|
101
126
|
status.success? ? out.split(/\r?\n/).map(&:strip).reject(&:empty?) : []
|
102
127
|
end
|
103
|
-
rescue StandardError
|
128
|
+
rescue StandardError => e
|
129
|
+
Kettle::Dev.debug_error(e, __method__)
|
104
130
|
[]
|
105
131
|
end
|
106
132
|
|
@@ -110,7 +136,8 @@ module Kettle
|
|
110
136
|
@git.remotes.each_with_object({}) do |r, h|
|
111
137
|
begin
|
112
138
|
h[r.name] = r.url
|
113
|
-
rescue StandardError
|
139
|
+
rescue StandardError => e
|
140
|
+
Kettle::Dev.debug_error(e, __method__)
|
114
141
|
# ignore
|
115
142
|
end
|
116
143
|
end
|
@@ -126,7 +153,8 @@ module Kettle
|
|
126
153
|
end
|
127
154
|
urls
|
128
155
|
end
|
129
|
-
rescue StandardError
|
156
|
+
rescue StandardError => e
|
157
|
+
Kettle::Dev.debug_error(e, __method__)
|
130
158
|
{}
|
131
159
|
end
|
132
160
|
|
@@ -140,7 +168,8 @@ module Kettle
|
|
140
168
|
out, status = Open3.capture2("git", "config", "--get", "remote.#{name}.url")
|
141
169
|
status.success? ? out.strip : nil
|
142
170
|
end
|
143
|
-
rescue StandardError
|
171
|
+
rescue StandardError => e
|
172
|
+
Kettle::Dev.debug_error(e, __method__)
|
144
173
|
nil
|
145
174
|
end
|
146
175
|
|
@@ -136,6 +136,7 @@ module Kettle
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
rescue StandardError => e
|
139
|
+
Kettle::Dev.debug_error(e, __method__)
|
139
140
|
puts "WARNING: Skipped trimming MRI Ruby badges in README.md due to #{e.class}: #{e.message}"
|
140
141
|
end
|
141
142
|
|
@@ -159,7 +160,8 @@ module Kettle
|
|
159
160
|
cluster = tail[/\A\X/u]
|
160
161
|
chosen_grapheme = cluster unless cluster.to_s.empty?
|
161
162
|
end
|
162
|
-
rescue StandardError
|
163
|
+
rescue StandardError => e
|
164
|
+
Kettle::Dev.debug_error(e, __method__)
|
163
165
|
# Fallback: take first Unicode grapheme if any non-space char
|
164
166
|
chosen_grapheme ||= tail[/\A\X/u]
|
165
167
|
end
|
@@ -200,7 +202,8 @@ module Kettle
|
|
200
202
|
new_readme = lines.join("\n")
|
201
203
|
File.open(readme_path, "w") { |f| f.write(new_readme) }
|
202
204
|
end
|
203
|
-
rescue StandardError
|
205
|
+
rescue StandardError => e
|
206
|
+
Kettle::Dev.debug_error(e, __method__)
|
204
207
|
# ignore README normalization errors
|
205
208
|
end
|
206
209
|
|
@@ -237,7 +240,8 @@ module Kettle
|
|
237
240
|
if gspec3 != gspec
|
238
241
|
File.open(gemspec_path, "w") { |f| f.write(gspec3) }
|
239
242
|
end
|
240
|
-
rescue StandardError
|
243
|
+
rescue StandardError => e
|
244
|
+
Kettle::Dev.debug_error(e, __method__)
|
241
245
|
# ignore gemspec edits on error
|
242
246
|
end
|
243
247
|
end
|
@@ -134,7 +134,8 @@ module Kettle
|
|
134
134
|
new_constraint = ruby1_8[1]
|
135
135
|
rubocop_ruby_gem_version = ruby1_8[0].segments.join("_")
|
136
136
|
end
|
137
|
-
rescue StandardError
|
137
|
+
rescue StandardError => e
|
138
|
+
Kettle::Dev.debug_error(e, __method__)
|
138
139
|
# ignore, use default
|
139
140
|
ensure
|
140
141
|
new_constraint ||= ruby1_8[1]
|
@@ -178,6 +179,7 @@ module Kettle
|
|
178
179
|
helpers.copy_file_with_prompt(envlocal_src, envlocal_dest, allow_create: true, allow_replace: true)
|
179
180
|
end
|
180
181
|
rescue StandardError => e
|
182
|
+
Kettle::Dev.debug_error(e, __method__)
|
181
183
|
puts "WARNING: Skipped .env.local example copy due to #{e.class}: #{e.message}"
|
182
184
|
end
|
183
185
|
|
@@ -303,7 +305,8 @@ module Kettle
|
|
303
305
|
unless exes.empty?
|
304
306
|
c = replace_array_field.call(c, "executables", exes)
|
305
307
|
end
|
306
|
-
rescue StandardError
|
308
|
+
rescue StandardError => e
|
309
|
+
Kettle::Dev.debug_error(e, __method__)
|
307
310
|
# Best-effort carry-over; ignore any individual failure
|
308
311
|
end
|
309
312
|
end
|
@@ -384,7 +387,8 @@ module Kettle
|
|
384
387
|
end
|
385
388
|
end
|
386
389
|
end
|
387
|
-
rescue StandardError
|
390
|
+
rescue StandardError => e
|
391
|
+
Kettle::Dev.debug_error(e, __method__)
|
388
392
|
# ignore, leave dest_preserve_prefix as nil
|
389
393
|
end
|
390
394
|
|
@@ -520,10 +524,12 @@ module Kettle
|
|
520
524
|
end
|
521
525
|
end
|
522
526
|
end
|
523
|
-
rescue StandardError
|
527
|
+
rescue StandardError => e
|
528
|
+
Kettle::Dev.debug_error(e, __method__)
|
524
529
|
# ignore H1 preservation errors
|
525
530
|
end
|
526
|
-
rescue StandardError
|
531
|
+
rescue StandardError => e
|
532
|
+
Kettle::Dev.debug_error(e, __method__)
|
527
533
|
# Best effort; if anything fails, keep c as-is
|
528
534
|
end
|
529
535
|
|
@@ -104,22 +104,45 @@ module Kettle
|
|
104
104
|
def ensure_clean_git!(root:, task_label:)
|
105
105
|
inside_repo = begin
|
106
106
|
system("git", "-C", root.to_s, "rev-parse", "--is-inside-work-tree", out: File::NULL, err: File::NULL)
|
107
|
-
rescue StandardError
|
107
|
+
rescue StandardError => e
|
108
|
+
Kettle::Dev.debug_error(e, __method__)
|
108
109
|
false
|
109
110
|
end
|
110
111
|
return unless inside_repo
|
111
112
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
# Prefer GitAdapter for cleanliness check; fallback to porcelain output
|
114
|
+
clean = begin
|
115
|
+
Dir.chdir(root.to_s) { Kettle::Dev::GitAdapter.new.clean? }
|
116
|
+
rescue StandardError => e
|
117
|
+
Kettle::Dev.debug_error(e, __method__)
|
118
|
+
nil
|
119
|
+
end
|
120
|
+
|
121
|
+
if clean.nil?
|
122
|
+
# Fallback to shelling out to get both status and preview
|
123
|
+
status_output = begin
|
124
|
+
IO.popen(["git", "-C", root.to_s, "status", "--porcelain"], &:read).to_s
|
125
|
+
rescue StandardError => e
|
126
|
+
Kettle::Dev.debug_error(e, __method__)
|
127
|
+
""
|
128
|
+
end
|
129
|
+
return if status_output.strip.empty?
|
130
|
+
preview = status_output.lines.take(10).map(&:rstrip)
|
131
|
+
else
|
132
|
+
return if clean
|
133
|
+
# For messaging, provide a small preview via porcelain even when using the adapter
|
134
|
+
status_output = begin
|
135
|
+
IO.popen(["git", "-C", root.to_s, "status", "--porcelain"], &:read).to_s
|
136
|
+
rescue StandardError => e
|
137
|
+
Kettle::Dev.debug_error(e, __method__)
|
138
|
+
""
|
139
|
+
end
|
140
|
+
preview = status_output.lines.take(10).map(&:rstrip)
|
116
141
|
end
|
117
|
-
return if status_output.strip.empty?
|
118
142
|
|
119
143
|
puts "ERROR: Your git working tree has uncommitted changes."
|
120
144
|
puts "#{task_label} may modify files (e.g., .github/, .gitignore, *.gemspec)."
|
121
145
|
puts "Please commit or stash your changes, then re-run: rake #{task_label}"
|
122
|
-
preview = status_output.lines.take(10).map(&:rstrip)
|
123
146
|
unless preview.empty?
|
124
147
|
puts "Detected changes:"
|
125
148
|
preview.each { |l| puts " #{l}" }
|
@@ -162,7 +185,8 @@ module Kettle
|
|
162
185
|
end
|
163
186
|
end
|
164
187
|
end
|
165
|
-
rescue StandardError
|
188
|
+
rescue StandardError => e
|
189
|
+
Kettle::Dev.debug_error(e, __method__)
|
166
190
|
# If anything goes wrong parsing/matching, ignore the filter and proceed.
|
167
191
|
end
|
168
192
|
|
@@ -192,7 +216,8 @@ module Kettle
|
|
192
216
|
begin
|
193
217
|
token = "{KETTLE|DEV|GEM}"
|
194
218
|
content = content.gsub(token, "kettle-dev") if content.include?(token)
|
195
|
-
rescue StandardError
|
219
|
+
rescue StandardError => e
|
220
|
+
Kettle::Dev.debug_error(e, __method__)
|
196
221
|
# If replacement fails unexpectedly, proceed with content as-is
|
197
222
|
end
|
198
223
|
write_file(dest_path, content)
|
@@ -227,7 +252,8 @@ module Kettle
|
|
227
252
|
File.fnmatch?(pat, rel_dest, File::FNM_PATHNAME | File::FNM_EXTGLOB | File::FNM_DOTMATCH)
|
228
253
|
end
|
229
254
|
end
|
230
|
-
rescue StandardError
|
255
|
+
rescue StandardError => e
|
256
|
+
Kettle::Dev.debug_error(e, __method__)
|
231
257
|
# On any error, do not filter out (act as matched)
|
232
258
|
true
|
233
259
|
end
|
@@ -253,7 +279,8 @@ module Kettle
|
|
253
279
|
return
|
254
280
|
end
|
255
281
|
end
|
256
|
-
rescue StandardError
|
282
|
+
rescue StandardError => e
|
283
|
+
Kettle::Dev.debug_error(e, __method__)
|
257
284
|
# If determining matches fails, fall through to prompting logic
|
258
285
|
end
|
259
286
|
|
@@ -283,7 +310,8 @@ module Kettle
|
|
283
310
|
File.open(target, "wb") { |f| f.write(data) }
|
284
311
|
next
|
285
312
|
end
|
286
|
-
rescue StandardError
|
313
|
+
rescue StandardError => e
|
314
|
+
Kettle::Dev.debug_error(e, __method__)
|
287
315
|
# ignore compare errors; fall through to copy
|
288
316
|
end
|
289
317
|
end
|
@@ -320,7 +348,8 @@ module Kettle
|
|
320
348
|
File.open(target, "wb") { |f| f.write(data) }
|
321
349
|
next
|
322
350
|
end
|
323
|
-
rescue StandardError
|
351
|
+
rescue StandardError => e
|
352
|
+
Kettle::Dev.debug_error(e, __method__)
|
324
353
|
# ignore compare errors; fall through to copy
|
325
354
|
end
|
326
355
|
end
|
data/lib/kettle/dev/version.rb
CHANGED
data/lib/kettle/dev.rb
CHANGED
@@ -6,29 +6,70 @@
|
|
6
6
|
require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp("true").zero?
|
7
7
|
# :nocov:
|
8
8
|
|
9
|
+
# Autoload public CLI/APIs so requiring "kettle-dev" exposes them lazily
|
10
|
+
# for tests and executables. Files will be loaded on first constant access.
|
9
11
|
module Kettle
|
12
|
+
autoload :EmojiRegex, "kettle/emoji_regex"
|
10
13
|
module Dev
|
14
|
+
autoload :ChangelogCLI, "kettle/dev/changelog_cli"
|
15
|
+
autoload :CIHelpers, "kettle/dev/ci_helpers"
|
16
|
+
autoload :CIMonitor, "kettle/dev/ci_monitor"
|
17
|
+
autoload :CommitMsg, "kettle/dev/commit_msg"
|
18
|
+
autoload :ExitAdapter, "kettle/dev/exit_adapter"
|
19
|
+
autoload :GemSpecReader, "kettle/dev/gem_spec_reader"
|
20
|
+
autoload :GitAdapter, "kettle/dev/git_adapter"
|
21
|
+
autoload :GitCommitFooter, "kettle/dev/git_commit_footer"
|
22
|
+
autoload :InputAdapter, "kettle/dev/input_adapter"
|
23
|
+
autoload :ReadmeBackers, "kettle/dev/readme_backers"
|
24
|
+
autoload :ReleaseCLI, "kettle/dev/release_cli"
|
25
|
+
autoload :TemplateHelpers, "kettle/dev/template_helpers"
|
26
|
+
autoload :Version, "kettle/dev/version"
|
27
|
+
autoload :Versioning, "kettle/dev/versioning"
|
28
|
+
|
29
|
+
# Nested tasks namespace with autoloaded task modules
|
30
|
+
module Tasks
|
31
|
+
autoload :CITask, "kettle/dev/tasks/ci_task"
|
32
|
+
autoload :InstallTask, "kettle/dev/tasks/install_task"
|
33
|
+
autoload :TemplateTask, "kettle/dev/tasks/template_task"
|
34
|
+
end
|
35
|
+
|
11
36
|
# Base error type for kettle-dev.
|
12
37
|
class Error < StandardError; end
|
13
38
|
|
14
39
|
# Whether debug logging is enabled for kettle-dev internals.
|
15
40
|
# @return [Boolean]
|
16
41
|
DEBUGGING = ENV.fetch("DEBUG", "false").casecmp("true").zero?
|
42
|
+
# Backwards-compat for kettle-dev specific debug variable
|
43
|
+
DEBUGGING ||= ENV.fetch("KETTLE_DEV_DEBUG", "false").casecmp("true").zero?
|
17
44
|
# Whether we are running on CI.
|
18
45
|
# @return [Boolean]
|
19
46
|
IS_CI = ENV.fetch("CI", "false").casecmp("true") == 0
|
20
47
|
# Whether to benchmark requires with require_bench.
|
21
48
|
# @return [Boolean]
|
22
49
|
REQUIRE_BENCH = ENV.fetch("REQUIRE_BENCH", "false").casecmp("true").zero?
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
50
|
+
# The current program name (e.g., "rake", "rspec").
|
51
|
+
# Used to decide whether to auto-load rake tasks at the bottom of this file.
|
52
|
+
# Normally tasks are loaded in the host project's Rakefile, but when running
|
53
|
+
# under this gem's own test suite we need precise coverage; so we only
|
54
|
+
# auto-install tasks when invoked via the rake executable.
|
55
|
+
# @return [String]
|
27
56
|
RUNNING_AS = File.basename($PROGRAM_NAME)
|
28
57
|
|
29
58
|
@defaults = []
|
30
59
|
|
31
60
|
class << self
|
61
|
+
# Emit a debug warning for rescued errors when DEBUG=true.
|
62
|
+
# @param error [Exception]
|
63
|
+
# @param context [String, Symbol, nil] optional label, often __method__
|
64
|
+
# @return [void]
|
65
|
+
def debug_error(error, context = nil)
|
66
|
+
return unless DEBUGGING
|
67
|
+
ctx = context ? context.to_s : "rescue"
|
68
|
+
Kernel.warn("[#{ctx}] #{error.class}: #{error.message}")
|
69
|
+
rescue Exception
|
70
|
+
# never raise from debug logging
|
71
|
+
end
|
72
|
+
|
32
73
|
# Install Rake tasks useful for development and tests.
|
33
74
|
#
|
34
75
|
# Adds RuboCop-LTS tasks, coverage tasks, and loads the
|
@@ -106,33 +147,4 @@ module Kettle
|
|
106
147
|
end
|
107
148
|
end
|
108
149
|
|
109
|
-
# Autoload public CLI/APIs so requiring "kettle-dev" exposes them lazily
|
110
|
-
# for tests and executables. Files will be loaded on first constant access.
|
111
|
-
module Kettle
|
112
|
-
autoload :EmojiRegex, "kettle/emoji_regex"
|
113
|
-
module Dev
|
114
|
-
autoload :ChangelogCLI, "kettle/dev/changelog_cli"
|
115
|
-
autoload :CIHelpers, "kettle/dev/ci_helpers"
|
116
|
-
autoload :CIMonitor, "kettle/dev/ci_monitor"
|
117
|
-
autoload :CommitMsg, "kettle/dev/commit_msg"
|
118
|
-
autoload :ExitAdapter, "kettle/dev/exit_adapter"
|
119
|
-
autoload :GemSpecReader, "kettle/dev/gem_spec_reader"
|
120
|
-
autoload :GitAdapter, "kettle/dev/git_adapter"
|
121
|
-
autoload :GitCommitFooter, "kettle/dev/git_commit_footer"
|
122
|
-
autoload :InputAdapter, "kettle/dev/input_adapter"
|
123
|
-
autoload :ReadmeBackers, "kettle/dev/readme_backers"
|
124
|
-
autoload :ReleaseCLI, "kettle/dev/release_cli"
|
125
|
-
autoload :TemplateHelpers, "kettle/dev/template_helpers"
|
126
|
-
autoload :Version, "kettle/dev/version"
|
127
|
-
autoload :Versioning, "kettle/dev/versioning"
|
128
|
-
|
129
|
-
# Nested tasks namespace with autoloaded task modules
|
130
|
-
module Tasks
|
131
|
-
autoload :CITask, "kettle/dev/tasks/ci_task"
|
132
|
-
autoload :InstallTask, "kettle/dev/tasks/install_task"
|
133
|
-
autoload :TemplateTask, "kettle/dev/tasks/template_task"
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
150
|
Kettle::Dev.install_tasks if Kettle::Dev::RUNNING_AS == "rake"
|
@@ -2,15 +2,16 @@ module Kettle
|
|
2
2
|
module Dev
|
3
3
|
class GitAdapter
|
4
4
|
def initialize: () -> void
|
5
|
-
def
|
5
|
+
def capture: (Array[String] args) -> [String, bool]
|
6
|
+
def push: (String? remote, String branch, force: bool) -> bool
|
6
7
|
def current_branch: () -> String?
|
7
8
|
def remotes: () -> Array[String]
|
8
9
|
def remotes_with_urls: () -> Hash[String, String]
|
9
|
-
def remote_url: (String) -> String?
|
10
|
-
def checkout: (String) -> bool
|
11
|
-
def pull: (String, String) -> bool
|
12
|
-
def fetch: (String, String?) -> bool
|
13
|
-
def
|
10
|
+
def remote_url: (String name) -> String?
|
11
|
+
def checkout: (String branch) -> bool
|
12
|
+
def pull: (String remote, String branch) -> bool
|
13
|
+
def fetch: (String remote, String? ref) -> bool
|
14
|
+
def clean?: () -> bool
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/sig/kettle/dev/tasks.rbs
CHANGED
data/sig/kettle/dev.rbs
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|