kettle-dev 1.0.26 → 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.
@@ -116,5 +116,51 @@ Gem::Specification.new do |spec|
116
116
  # and preferably a modular one (see gemfiles/modular/*.gemfile).
117
117
 
118
118
  # Dev, Test, & Release Tasks
119
- spec.add_development_dependency("{KETTLE|DEV|GEM}", "~> 1.0.17") # ruby >= 2.3.0
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
- status_output = begin
113
- IO.popen(["git", "-C", root.to_s, "status", "--porcelain"], &:read).to_s
114
- rescue StandardError
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
@@ -6,7 +6,90 @@ module Kettle
6
6
  module Version
7
7
  # The gem version.
8
8
  # @return [String]
9
- VERSION = "1.0.26"
9
+ VERSION = "1.1.0"
10
+
11
+ module_function
12
+
13
+ # rubocop:disable ThreadSafety/ClassInstanceVariable
14
+ #
15
+ # The logic below, through the end of the file, comes from version_gem.
16
+ # Extracted because version_gem depends on this gem, and circular dependencies are bad.
17
+ #
18
+ # A Gem::Version for this version string
19
+ #
20
+ # Useful when you need to compare versions or pass a Gem::Version instance
21
+ # to APIs that expect it. This is equivalent to `Gem::Version.new(to_s)`.
22
+ #
23
+ # @return [Gem::Version]
24
+ def gem_version
25
+ @gem_version ||= ::Gem::Version.new(to_s)
26
+ end
27
+
28
+ # The version number as a string
29
+ #
30
+ # @return [String]
31
+ def to_s
32
+ self::VERSION
33
+ end
34
+
35
+ # The major version
36
+ #
37
+ # @return [Integer]
38
+ def major
39
+ @major ||= _to_a[0].to_i
40
+ end
41
+
42
+ # The minor version
43
+ #
44
+ # @return [Integer]
45
+ def minor
46
+ @minor ||= _to_a[1].to_i
47
+ end
48
+
49
+ # The patch version
50
+ #
51
+ # @return [Integer]
52
+ def patch
53
+ @patch ||= _to_a[2].to_i
54
+ end
55
+
56
+ # The pre-release version, if any
57
+ #
58
+ # @return [String, NilClass]
59
+ def pre
60
+ @pre ||= _to_a[3]
61
+ end
62
+
63
+ # The version number as a hash
64
+ #
65
+ # @return [Hash]
66
+ def to_h
67
+ @to_h ||= {
68
+ major: major,
69
+ minor: minor,
70
+ patch: patch,
71
+ pre: pre,
72
+ }
73
+ end
74
+
75
+ # The version number as an array of cast values
76
+ #
77
+ # @return [Array<[Integer, String, NilClass]>]
78
+ def to_a
79
+ @to_a ||= [major, minor, patch, pre]
80
+ end
81
+
82
+ private
83
+
84
+ module_function
85
+
86
+ # The version number as an array of strings
87
+ #
88
+ # @return [Array<String>]
89
+ def _to_a
90
+ @_to_a = self::VERSION.split(".")
91
+ end
92
+ # rubocop:enable ThreadSafety/ClassInstanceVariable
10
93
  end
11
94
  end
12
95
  end
data/lib/kettle/dev.rb CHANGED
@@ -5,31 +5,71 @@
5
5
  # :nocov:
6
6
  require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp("true").zero?
7
7
  # :nocov:
8
- require "version_gem"
9
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.
10
11
  module Kettle
12
+ autoload :EmojiRegex, "kettle/emoji_regex"
11
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
+
12
36
  # Base error type for kettle-dev.
13
37
  class Error < StandardError; end
14
38
 
15
39
  # Whether debug logging is enabled for kettle-dev internals.
16
40
  # @return [Boolean]
17
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?
18
44
  # Whether we are running on CI.
19
45
  # @return [Boolean]
20
46
  IS_CI = ENV.fetch("CI", "false").casecmp("true") == 0
21
47
  # Whether to benchmark requires with require_bench.
22
48
  # @return [Boolean]
23
49
  REQUIRE_BENCH = ENV.fetch("REQUIRE_BENCH", "false").casecmp("true").zero?
24
- # Whether to load rake tasks at the bottom of this file.
25
- # Normally they would be loaded in the project's Rakefile,
26
- # but if we do that in this project then we can't get accurate code coverage.
27
- # @return [Boolean]
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]
28
56
  RUNNING_AS = File.basename($PROGRAM_NAME)
29
57
 
30
58
  @defaults = []
31
59
 
32
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
+
33
73
  # Install Rake tasks useful for development and tests.
34
74
  #
35
75
  # Adds RuboCop-LTS tasks, coverage tasks, and loads the
@@ -107,37 +147,4 @@ module Kettle
107
147
  end
108
148
  end
109
149
 
110
- # Autoload public CLI/APIs so requiring "kettle-dev" exposes them lazily
111
- # for tests and executables. Files will be loaded on first constant access.
112
- module Kettle
113
- autoload :EmojiRegex, "kettle/emoji_regex"
114
- module Dev
115
- autoload :ChangelogCLI, "kettle/dev/changelog_cli"
116
- autoload :CIHelpers, "kettle/dev/ci_helpers"
117
- autoload :CIMonitor, "kettle/dev/ci_monitor"
118
- autoload :CommitMsg, "kettle/dev/commit_msg"
119
- autoload :ExitAdapter, "kettle/dev/exit_adapter"
120
- autoload :GemSpecReader, "kettle/dev/gem_spec_reader"
121
- autoload :GitAdapter, "kettle/dev/git_adapter"
122
- autoload :GitCommitFooter, "kettle/dev/git_commit_footer"
123
- autoload :InputAdapter, "kettle/dev/input_adapter"
124
- autoload :ReadmeBackers, "kettle/dev/readme_backers"
125
- autoload :ReleaseCLI, "kettle/dev/release_cli"
126
- autoload :TemplateHelpers, "kettle/dev/template_helpers"
127
- autoload :Version, "kettle/dev/version"
128
- autoload :Versioning, "kettle/dev/versioning"
129
-
130
- # Nested tasks namespace with autoloaded task modules
131
- module Tasks
132
- autoload :CITask, "kettle/dev/tasks/ci_task"
133
- autoload :InstallTask, "kettle/dev/tasks/install_task"
134
- autoload :TemplateTask, "kettle/dev/tasks/template_task"
135
- end
136
- end
137
- end
138
-
139
- Kettle::Dev::Version.class_eval do
140
- extend VersionGem::Basic
141
- end
142
-
143
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 push: (String?, String, force: bool) -> bool
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 capture: (Array[String]) -> [String, bool]
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
@@ -0,0 +1,7 @@
1
+ module Kettle
2
+ module Dev
3
+ module Tasks
4
+ # Namespace module for task-related classes and Rake task loaders.
5
+ end
6
+ end
7
+ end
data/sig/kettle/dev.rbs CHANGED
@@ -10,6 +10,7 @@ module Kettle
10
10
  DEBUGGING: bool
11
11
  IS_CI: bool
12
12
  REQUIRE_BENCH: bool
13
+ RUNNING_AS: String
13
14
 
14
15
  # Singleton methods
15
16
  def self.install_tasks: () -> void
data.tar.gz.sig CHANGED
Binary file