kettle-dev 1.0.2 → 1.0.3

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: ecdb3d6d039419832299b33679576735dc54bb4a0a2e3e6eadbc0025a8dc12d7
4
- data.tar.gz: 0f83cc1bcaf33136687b4374830318a3621123c20300a6b97b7acab310ea4d34
3
+ metadata.gz: 8e3927849812294208b1d9f6f582fbe820790c106e168b9fb0928069aedb2217
4
+ data.tar.gz: ce1c09f75c7d044737f06c541da118c3925925858db156acd8bf97f71e7c13ca
5
5
  SHA512:
6
- metadata.gz: 516fe50f03c591f5501b056fda8cdeadca1a0f743117c04c651159f6b4b3bf53069460ed28369cba9f9964277457513fcd76051add3fdda7d8fb0f4e579723a2
7
- data.tar.gz: 625d8c9ecc7b900aa60f6e758f1467ec7114ebb26017ae5bbae3eebe6cd259ac808b6b67acbb163998a091b2a369c55cc45dc532c6b24006bc4fcd00674f120b
6
+ metadata.gz: cdb45f3c3440b061c0ccbc21a9a315a7d87be88ce8f2389a0b530a21615e7908ea397ea4208a34f3e4eeb4e2af2a7b6c9db466af25348ae927840be46a456d55
7
+ data.tar.gz: d9a60711d6d6c09b4203531551b733ae0c148da55507169cb9cbc0f002cc7e2f69b4c17b53ae0f6e3d8cff6b4302c5cb47209672d2969aa73247b3c14bb50752
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -12,6 +12,18 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
12
12
  ### Fixed
13
13
  ### Security
14
14
 
15
+ ## [1.0.3] - 2025-08-24
16
+ - TAG: [v1.0.3][1.0.3t]
17
+ - COVERAGE: 100.00% -- 98/98 lines in 7 files
18
+ - BRANCH COVERAGE: 100.00% -- 30/30 branches in 7 files
19
+ - 94.59% documented
20
+ ### Added
21
+ - template task now copies .git-hooks files necessary for git hooks to work
22
+ ### Fixed
23
+ - kettle-release now uses the host project's root, instead of this gem's installed root.
24
+ - Added .git-hooks files necessary for git hooks to work
25
+
26
+
15
27
  ## [1.0.2] - 2025-08-24
16
28
  - TAG: [v1.0.2][1.0.2t]
17
29
  - COVERAGE: 100.00% -- 98/98 lines in 7 files
@@ -59,7 +71,9 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
59
71
  - Selecting will run the selected workflow via `act`
60
72
  - This may move to its own gem in the future.
61
73
 
62
- [Unreleased]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.2...HEAD
74
+ [Unreleased]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.3...HEAD
75
+ [1.0.3]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.2...v1.0.3
76
+ [1.0.3t]: https://gitlab.com/kettle-rb/kettle-dev/-/tags/v1.0.3
63
77
  [1.0.2]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.1...v1.0.2
64
78
  [1.0.2t]: https://gitlab.com/kettle-rb/kettle-dev/-/tags/v1.0.2
65
79
  [1.0.1]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.0...v1.0.1
@@ -0,0 +1 @@
1
+ 996386236fb02c4837bcab0d180f39604e8f0c93535531e6aded6cfbf804ad0a
@@ -0,0 +1 @@
1
+ 67fde9c262cbf74e7ea89e18ba3b7a737aad2cc7a596660931e2e42e73bbc8bfd9a778b6f54d79902ef6a48783fa0f90277b7dcb656a7e3c9d63c2192baaae85
data/exe/kettle-release CHANGED
@@ -12,8 +12,6 @@
12
12
  # - Runs bin/gem_checksums
13
13
  # - Runs `bundle exec rake release` (expects PEM password and RubyGems MFA OTP)
14
14
 
15
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
16
-
17
15
  require "rubygems"
18
16
  require "bundler/setup"
19
17
 
@@ -31,7 +29,8 @@ module Kettle
31
29
  module Dev
32
30
  class ReleaseCLI
33
31
  def initialize
34
- @root = File.expand_path("..", __dir__)
32
+ # Use the host project's root, not the installed gem's directory
33
+ @root = Kettle::Dev::CIHelpers.project_root
35
34
  end
36
35
 
37
36
  def run
@@ -358,11 +358,18 @@ namespace :kettle do
358
358
  puts "WARNING: Could not determine env file changes: #{e.class}: #{e.message}"
359
359
  end
360
360
 
361
- # Handle .git-hooks template files (commit-subjects-goalie.txt, footer-template.erb.txt)
361
+ # Handle .git-hooks files
362
+ # - Two template files (.txt) are offered with a location prompt (local/global/skip).
363
+ # - Two hook scripts are always copied to both local and global locations by default;
364
+ # if they already exist, ask before overwriting.
362
365
  source_hooks_dir = File.join(gem_checkout_root, ".git-hooks")
363
366
  if Dir.exist?(source_hooks_dir)
364
367
  goalie_src = File.join(source_hooks_dir, "commit-subjects-goalie.txt")
365
368
  footer_src = File.join(source_hooks_dir, "footer-template.erb.txt")
369
+ hook_ruby_src = File.join(source_hooks_dir, "commit-msg")
370
+ hook_sh_src = File.join(source_hooks_dir, "prepare-commit-msg")
371
+
372
+ # First: templates (.txt) — keep the existing single question which applies only to these
366
373
  if File.file?(goalie_src) && File.file?(footer_src)
367
374
  puts
368
375
  puts "Git hooks templates found:"
@@ -394,19 +401,60 @@ namespace :kettle do
394
401
  FileUtils.mkdir_p(dest_dir)
395
402
  [[goalie_src, "commit-subjects-goalie.txt"], [footer_src, "footer-template.erb.txt"]].each do |src, base|
396
403
  dest = File.join(dest_dir, base)
397
- FileUtils.cp(src, dest)
404
+ # Use helpers to allow create/replace prompts for these files (question applies to them)
405
+ helpers.copy_file_with_prompt(src, dest, allow_create: true, allow_replace: true)
398
406
  # Ensure readable (0644). These are data/templates, not executables.
399
407
  begin
400
- File.chmod(0o644, dest)
408
+ File.chmod(0o644, dest) if File.exist?(dest)
401
409
  rescue StandardError
402
410
  # ignore permission issues
403
411
  end
404
- puts "Copied #{base} -> #{dest}"
405
412
  end
406
413
  else
407
414
  puts "Skipping copy of .git-hooks templates."
408
415
  end
409
416
  end
417
+
418
+ # Second: hook scripts — copy only to the local project; prompt only on overwrite
419
+ # Per requirements: do not install hook scripts to global ~/.git-hooks
420
+ hook_dests = [File.join(project_root, ".git-hooks")]
421
+ hook_pairs = [[hook_ruby_src, "commit-msg", 0o755], [hook_sh_src, "prepare-commit-msg", 0o755]]
422
+ hook_pairs.each do |src, base, mode|
423
+ next unless File.file?(src)
424
+ hook_dests.each do |dstdir|
425
+ begin
426
+ FileUtils.mkdir_p(dstdir)
427
+ dest = File.join(dstdir, base)
428
+ # Create without prompt if missing; if exists, ask to replace
429
+ if File.exist?(dest)
430
+ # ask to overwrite
431
+ if helpers.ask("Overwrite existing #{dest}?", true)
432
+ content = File.read(src)
433
+ helpers.write_file(dest, content)
434
+ begin
435
+ File.chmod(mode, dest)
436
+ rescue StandardError
437
+ # ignore permission issues
438
+ end
439
+ puts "Replaced #{dest}"
440
+ else
441
+ puts "Kept existing #{dest}"
442
+ end
443
+ else
444
+ content = File.read(src)
445
+ helpers.write_file(dest, content)
446
+ begin
447
+ File.chmod(mode, dest)
448
+ rescue StandardError
449
+ # ignore permission issues
450
+ end
451
+ puts "Installed #{dest}"
452
+ end
453
+ rescue StandardError => e
454
+ puts "WARNING: Could not install hook #{base} to #{dstdir}: #{e.class}: #{e.message}"
455
+ end
456
+ end
457
+ end
410
458
  end
411
459
  end
412
460
  end
@@ -6,7 +6,7 @@ module Kettle
6
6
  module Version
7
7
  # The gem version.
8
8
  # @return [String]
9
- VERSION = "1.0.2"
9
+ VERSION = "1.0.3"
10
10
  end
11
11
  end
12
12
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -209,6 +209,8 @@ extra_rdoc_files:
209
209
  - checksums/kettle-dev-1.0.1.gem.sha512
210
210
  - checksums/kettle-dev-1.0.2.gem.sha256
211
211
  - checksums/kettle-dev-1.0.2.gem.sha512
212
+ - checksums/kettle-dev-1.0.3.gem.sha256
213
+ - checksums/kettle-dev-1.0.3.gem.sha512
212
214
  files:
213
215
  - ".devcontainer/devcontainer.json"
214
216
  - ".envrc"
@@ -266,6 +268,8 @@ files:
266
268
  - checksums/kettle-dev-1.0.1.gem.sha512
267
269
  - checksums/kettle-dev-1.0.2.gem.sha256
268
270
  - checksums/kettle-dev-1.0.2.gem.sha512
271
+ - checksums/kettle-dev-1.0.3.gem.sha256
272
+ - checksums/kettle-dev-1.0.3.gem.sha512
269
273
  - exe/kettle-commit-msg
270
274
  - exe/kettle-readme-backers
271
275
  - exe/kettle-release
@@ -298,10 +302,10 @@ licenses:
298
302
  - MIT
299
303
  metadata:
300
304
  homepage_uri: https://kettle-dev.galtzo.com/
301
- source_code_uri: https://github.com/galtzo-floss/kettle-dev/tree/v1.0.2
302
- changelog_uri: https://github.com/galtzo-floss/kettle-dev/blob/v1.0.2/CHANGELOG.md
305
+ source_code_uri: https://github.com/galtzo-floss/kettle-dev/tree/v1.0.3
306
+ changelog_uri: https://github.com/galtzo-floss/kettle-dev/blob/v1.0.3/CHANGELOG.md
303
307
  bug_tracker_uri: https://github.com/galtzo-floss/kettle-dev/issues
304
- documentation_uri: https://www.rubydoc.info/gems/kettle-dev/1.0.2
308
+ documentation_uri: https://www.rubydoc.info/gems/kettle-dev/1.0.3
305
309
  funding_uri: https://github.com/sponsors/pboling
306
310
  wiki_uri: https://github.com/galtzo-floss/kettle-dev/wiki
307
311
  news_uri: https://www.railsbling.com/tags/kettle-dev
metadata.gz.sig CHANGED
Binary file