kettle-dev 2.3.10 → 2.4.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: 043a73e1a2fb35f02748261dc4d5f81865e233a982c10b73d6b957ef7a7ce66d
4
- data.tar.gz: 4695065e3a9a9ce34f586fb4baeb76064b59048914a7c12e5e1590435dfe5862
3
+ metadata.gz: dc6dd6b412d11d659d2f5ed0916372e599642a82640335700f3e723937638cba
4
+ data.tar.gz: 86114a4e096dd7da0934477c06aee521372d6eeb5f2114377d0a035b32be42f1
5
5
  SHA512:
6
- metadata.gz: 555075c8b24c72b0a3ae955d790d0af6b97f265a5fcd00dd3aad16bf3c46ca315081b64d6a39553039e70c438774553826eb7e2a7ecc358e441fa1a066cadeb1
7
- data.tar.gz: 896b19afe31b86aaed964605cf63767ec1d8bc4d8c214e1599835781c2f86919d1510d1601a7597cb53cf57713812779b07de550d710e0d7ac40c3c4f7d28d4b
6
+ metadata.gz: f056c2d67dee284c734c2b0bf5cb06ce957d981cc7c8f922108b2cf1c3b3a8acf5c0c2a1fe8b7b3347ae92c85f780f82ab1e14cf677e12591ece125522bdf967
7
+ data.tar.gz: 1c5db4b16afe9840dca06f5a6a1528fe3afa3dadb68b727c2b95c43bfa3240d19625aad892a792000841b42640d07451136f0f87a18f2e711aba5f7107721368
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,39 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [2.4.0] - 2026-07-23
34
+
35
+ - TAG: [v2.4.0][2.4.0t]
36
+ - COVERAGE: 92.49% -- 3830/4141 lines in 38 files
37
+ - BRANCH COVERAGE: 76.22% -- 1516/1989 branches in 38 files
38
+ - 58.66% documented
39
+
40
+ ### Added
41
+
42
+ - Packaged executables now answer `-v` and bare `--version` with the
43
+ `kettle-dev` gem version they shipped with.
44
+
45
+ ### Changed
46
+
47
+ - Raised the runtime dependency floor for `kettle-gha-pins` to `0.3.1`.
48
+ - Packaged executables now share a consistent startup header on normal
49
+ execution paths.
50
+ - Markdown image URL cache/live/skipped progress now uses the same multi-line
51
+ `tty-progressbar` output as GitHub Actions pin checks.
52
+
53
+ ## [2.3.11] - 2026-07-23
54
+
55
+ - TAG: [v2.3.11][2.3.11t]
56
+ - COVERAGE: 92.17% -- 3791/4113 lines in 37 files
57
+ - BRANCH COVERAGE: 75.80% -- 1500/1979 branches in 37 files
58
+ - 59.51% documented
59
+
60
+ ### Fixed
61
+
62
+ - GitHub Actions release monitoring now falls back to repository-level workflow
63
+ runs when a per-workflow endpoint lags for the pushed HEAD, and waits up to
64
+ five minutes by default for workflows to appear.
65
+
33
66
  ## [2.3.10] - 2026-07-23
34
67
 
35
68
  - TAG: [v2.3.10][2.3.10t]
@@ -2613,7 +2646,11 @@ Please file a bug if you notice a violation of semantic versioning.
2613
2646
  - Selecting will run the selected workflow via `act`
2614
2647
  - This may move to its own gem in the future.
2615
2648
 
2616
- [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v2.3.10...HEAD
2649
+ [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v2.4.0...HEAD
2650
+ [2.4.0]: https://github.com/kettle-dev/kettle-dev/compare/v2.3.11...v2.4.0
2651
+ [2.4.0t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v2.4.0
2652
+ [2.3.11]: https://github.com/kettle-dev/kettle-dev/compare/v2.3.10...v2.3.11
2653
+ [2.3.11t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v2.3.11
2617
2654
  [2.3.10]: https://github.com/kettle-dev/kettle-dev/compare/v2.3.9...v2.3.10
2618
2655
  [2.3.10t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v2.3.10
2619
2656
  [2.3.9]: https://github.com/kettle-dev/kettle-dev/compare/v2.3.8...v2.3.9
data/LICENSE.md CHANGED
@@ -3,7 +3,7 @@
3
3
  This project is made available under the following license.
4
4
  Choose the option that best fits your use case:
5
5
 
6
- - [AGPL-3.0-only](AGPL-3.0-only.md)
6
+ - [AGPL-3.0-only](https://github.com/kettle-dev/kettle-dev/blob/main/AGPL-3.0-only.md)
7
7
 
8
8
  If none of the above licenses fit your use case, please [contact us](mailto:floss@galtzo.com) to discuss a custom commercial license.
9
9
 
data/README.md CHANGED
@@ -94,7 +94,7 @@ bin/kettle-release
94
94
  | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
95
95
  | Works with MRI Ruby 2 | [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
96
96
  | Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Get help from RubyForum][✉️ruby-forum-img]][✉️ruby-forum] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
97
- | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
97
+ | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on GitHub.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
98
98
  | Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
99
99
  | Compliance | [![License: AGPL-3.0-only][📄license-img]][📄license] [![Apache license compatibility: Category X][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
100
100
  | Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] [![Compatibility appraised by: appraisal2][💎appraisal2-img]][💎appraisal2] |
@@ -666,7 +666,7 @@ See [CHANGELOG.md][📌changelog] for a list of releases.
666
666
 
667
667
  ## 📄 License
668
668
 
669
- The gem is available under the following license: [AGPL-3.0-only](AGPL-3.0-only.md).
669
+ The gem is available under the following license: [AGPL-3.0-only](https://github.com/kettle-dev/kettle-dev/blob/main/AGPL-3.0-only.md).
670
670
  See [LICENSE.md][📄license] for details.
671
671
 
672
672
  If none of the available licenses suit your use case, please [contact us](mailto:floss@galtzo.com) to discuss a custom commercial license.
@@ -783,7 +783,7 @@ Thanks for RTFM. ☺️
783
783
  [📜src-gl]: https://gitlab.com/kettle-dev/kettle-dev
784
784
  [📜src-cb-img]: https://img.shields.io/badge/CodeBerg-4893CC?style=for-the-badge&logo=CodeBerg&logoColor=blue
785
785
  [📜src-cb]: https://codeberg.org/kettle-dev/kettle-dev
786
- [📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
786
+ [📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=GitHub&logoColor=green
787
787
  [📜src-gh]: https://github.com/kettle-dev/kettle-dev
788
788
  [📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
789
789
  [📜docs-head-rd-img]: https://img.shields.io/badge/YARD_on_Galtzo.com-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
@@ -891,12 +891,12 @@ Thanks for RTFM. ☺️
891
891
  [📌gitmoji]: https://gitmoji.dev
892
892
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
893
893
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
894
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-4.104-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
894
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-4.141-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
895
895
  [🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
896
896
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
897
897
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
898
898
  [📄license]: LICENSE.md
899
- [📄license-ref]: AGPL-3.0-only.md
899
+ [📄license-ref]: https://github.com/kettle-dev/kettle-dev/blob/main/AGPL-3.0-only.md
900
900
  [📄license-img]: https://img.shields.io/badge/License-AGPL--3.0--only-259D6C.svg
901
901
  [📄license-compat]: https://www.apache.org/legal/resolved.html#category-x
902
902
  [📄license-compat-img]: https://img.shields.io/badge/Apache_Incompatible:_Category_X-%E2%9C%97-C0392B.svg?style=flat&logo=Apache
data/exe/kettle-bump CHANGED
@@ -15,10 +15,14 @@ rescue LoadError
15
15
  end
16
16
 
17
17
  script_basename = File.basename(__FILE__)
18
+ repo_lib = File.expand_path("../lib", __dir__)
19
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
18
20
 
19
21
  begin
20
22
  require "kettle/dev"
21
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
23
+ require "kettle/dev/executable_version"
24
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
25
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
22
26
  rescue LoadError => e
23
27
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
24
28
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
data/exe/kettle-changelog CHANGED
@@ -36,6 +36,8 @@ rescue LoadError
36
36
  end
37
37
 
38
38
  script_basename = File.basename(__FILE__)
39
+ repo_lib = File.expand_path("../lib", __dir__)
40
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
39
41
 
40
42
  begin
41
43
  # Standard library
@@ -46,7 +48,9 @@ begin
46
48
 
47
49
  # This library
48
50
  require "kettle/dev"
49
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} ==" unless ARGV.include?("--json")
51
+ require "kettle/dev/executable_version"
52
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV, value_option: true)
53
+ Kettle::Dev::ExecutableVersion.print_header(script_basename) unless ARGV.include?("--json")
50
54
  rescue LoadError => e
51
55
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
52
56
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
data/exe/kettle-check-eof CHANGED
@@ -1,6 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ $stdout.sync = true
5
+ $stderr.sync = true
6
+
7
+ repo_lib = File.expand_path("../lib", __dir__)
8
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
9
+
10
+ require "kettle/dev/executable_version"
11
+
12
+ script_basename = File.basename(__FILE__)
13
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
14
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
15
+
4
16
  bin_dir = File.expand_path(__dir__)
5
17
  bash_script = File.join(bin_dir, "kettle-check-eof.sh")
6
18
 
@@ -16,6 +16,8 @@ rescue LoadError
16
16
  end
17
17
 
18
18
  script_basename = File.basename(__FILE__)
19
+ repo_lib = File.expand_path("../lib", __dir__)
20
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
19
21
 
20
22
  begin
21
23
  # Standard library
@@ -25,11 +27,12 @@ begin
25
27
  require "kettle/dev"
26
28
  rescue LoadError
27
29
  # Fallback: allow running from a checkout without bundler by adding ./lib to the load path
28
- repo_lib = File.expand_path("../lib", __dir__)
29
30
  $LOAD_PATH.unshift(repo_lib) unless $LOAD_PATH.include?(repo_lib)
30
31
  require "kettle/dev"
31
32
  end
32
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
33
+ require "kettle/dev/executable_version"
34
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
35
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
33
36
  rescue LoadError => e
34
37
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
35
38
  warn("Hint: Install the kettle-dev gem (`gem install kettle-dev`) or add it to your Gemfile. Bundler is not required for this script.")
data/exe/kettle-dev-setup CHANGED
@@ -6,6 +6,15 @@
6
6
  # kettle-dev-setup has been replaced by kettle-jem setup.
7
7
  # All setup and templating functionality has moved to the kettle-jem gem.
8
8
 
9
+ repo_lib = File.expand_path("../lib", __dir__)
10
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
11
+
12
+ require "kettle/dev/executable_version"
13
+
14
+ script_basename = File.basename(__FILE__)
15
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
16
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
17
+
9
18
  warn <<~MSG
10
19
  kettle-dev-setup has been removed.
11
20
  Setup and templating functionality has moved to the kettle-jem gem.
data/exe/kettle-dvcs CHANGED
@@ -20,10 +20,14 @@ rescue LoadError
20
20
  end
21
21
 
22
22
  script_basename = File.basename(__FILE__)
23
+ repo_lib = File.expand_path("../lib", __dir__)
24
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
23
25
 
24
26
  begin
25
27
  require "kettle/dev"
26
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
28
+ require "kettle/dev/executable_version"
29
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
30
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
27
31
  rescue LoadError => e
28
32
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
29
33
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
@@ -21,10 +21,14 @@ rescue LoadError
21
21
  end
22
22
 
23
23
  script_basename = File.basename(__FILE__)
24
+ repo_lib = File.expand_path("../lib", __dir__)
25
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
24
26
 
25
27
  begin
26
28
  require "kettle/dev"
27
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
29
+ require "kettle/dev/executable_version"
30
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
31
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
28
32
  rescue LoadError => e
29
33
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
30
34
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
@@ -3,9 +3,18 @@
3
3
 
4
4
  # vim: set syntax=ruby
5
5
 
6
+ $stdout.sync = true
7
+ $stderr.sync = true
8
+
6
9
  script_basename = File.basename(__FILE__)
10
+ repo_lib = File.expand_path("../lib", __dir__)
11
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
7
12
 
8
13
  begin
14
+ require "kettle/dev/executable_version"
15
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
16
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
17
+
9
18
  Kernel.exec(Gem.ruby, Gem.bin_path("kettle-gha-pins", "kettle-gha-pins"), *ARGV)
10
19
  rescue Gem::Exception, LoadError => e
11
20
  warn("#{script_basename}: could not load kettle-gha-pins executable: #{e.class}: #{e.message}")
@@ -23,10 +23,14 @@ rescue LoadError
23
23
  end
24
24
 
25
25
  script_basename = File.basename(__FILE__)
26
+ repo_lib = File.expand_path("../lib", __dir__)
27
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
26
28
 
27
29
  begin
28
30
  require "kettle/dev"
29
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
31
+ require "kettle/dev/executable_version"
32
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
33
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
30
34
  rescue => e
31
35
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
32
36
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
@@ -14,10 +14,14 @@ rescue LoadError
14
14
  end
15
15
 
16
16
  script_basename = File.basename(__FILE__)
17
+ repo_lib = File.expand_path("../lib", __dir__)
18
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
17
19
 
18
20
  begin
19
21
  require "kettle/dev"
20
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
22
+ require "kettle/dev/executable_version"
23
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV)
24
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
21
25
  rescue LoadError => e
22
26
  warn("kettle/dev: failed to load: #{e.message}")
23
27
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
data/exe/kettle-release CHANGED
@@ -29,10 +29,14 @@ rescue LoadError
29
29
  end
30
30
 
31
31
  script_basename = File.basename(__FILE__)
32
+ repo_lib = File.expand_path("../lib", __dir__)
33
+ $LOAD_PATH.unshift(repo_lib) if File.directory?(repo_lib) && !$LOAD_PATH.include?(repo_lib)
32
34
 
33
35
  begin
34
36
  require "kettle/dev"
35
- puts "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
37
+ require "kettle/dev/executable_version"
38
+ Kettle::Dev::ExecutableVersion.print_and_exit!(script_basename, ARGV, value_option: true)
39
+ Kettle::Dev::ExecutableVersion.print_header(script_basename)
36
40
  rescue LoadError => e
37
41
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
38
42
  warn("Hint: Ensure the host project has kettle-dev as a dependency and run bundle install.")
@@ -1,47 +1,60 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "ruby-progressbar"
3
+ require "tty-progressbar"
4
4
 
5
5
  module Kettle
6
6
  module Dev
7
7
  class CacheProgress
8
- FORMAT = "%t %b %c/%C"
9
- LENGTH = 30
8
+ FORMAT = "%<title>s [:bar] :current/:total"
9
+ WIDTH = 30
10
10
 
11
11
  def initialize(total:, cached_title:, live_title:, output:, enabled: true, skipped_title: nil)
12
12
  @total = total.to_i
13
13
  @cached_count = 0
14
14
  @live_count = 0
15
15
  @skipped_count = 0
16
- @cached_bar = progress_bar(cached_title, output, enabled)
17
- @live_bar = progress_bar(live_title, output, enabled)
18
- @skipped_bar = skipped_title ? progress_bar(skipped_title, output, enabled) : nil
16
+ @multibar = progress_enabled?(enabled, output) ? TTY::ProgressBar::Multi.new(output: output, width: WIDTH) : nil
17
+ @cached_bar = progress_bar(cached_title)
18
+ @live_bar = progress_bar(live_title)
19
+ @skipped_bar = skipped_title ? progress_bar(skipped_title) : nil
19
20
  end
20
21
 
21
22
  attr_reader :cached_count, :live_count, :skipped_count
22
23
 
23
24
  def cached
24
25
  @cached_count += 1
25
- @cached_bar&.increment
26
+ @cached_bar&.advance
26
27
  end
27
28
 
28
29
  def live
29
30
  @live_count += 1
30
- @live_bar&.increment
31
+ @live_bar&.advance
31
32
  end
32
33
 
33
34
  def skipped
34
35
  @skipped_count += 1
35
- @skipped_bar&.increment
36
+ @skipped_bar&.advance
37
+ end
38
+
39
+ def stop
40
+ @multibar&.stop
36
41
  end
37
42
 
38
43
  private
39
44
 
40
- def progress_bar(title, output, enabled)
41
- return unless enabled
45
+ def progress_enabled?(enabled, output)
46
+ enabled && @total.positive? && output.respond_to?(:tty?) && output.tty?
47
+ end
48
+
49
+ def progress_bar(title)
50
+ return unless @multibar
42
51
  return unless @total.positive?
43
52
 
44
- ProgressBar.create(title: title, total: @total, format: FORMAT, length: LENGTH, output: output)
53
+ @multibar.register(bar_format(title), total: @total)
54
+ end
55
+
56
+ def bar_format(title)
57
+ Kernel.format(FORMAT, title: title)
45
58
  end
46
59
  end
47
60
  end
@@ -97,19 +97,17 @@ module Kettle
97
97
 
98
98
  # Scope to the exact commit SHA when available to avoid picking up a previous run on the same branch.
99
99
  sha = head_sha || current_head_sha
100
- base_url = "https://api.github.com/repos/#{owner}/#{repo}/actions/workflows/#{workflow_file}/runs?branch=#{URI.encode_www_form_component(b)}&per_page=5"
101
- uri = URI(base_url)
102
- req = Net::HTTP::Get.new(uri)
103
- req["User-Agent"] = "kettle-dev/ci-helpers"
104
- req["Authorization"] = "token #{token}" if token && !token.empty?
105
- res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
106
- return unless res.is_a?(Net::HTTPSuccess)
100
+ data = github_get_json(
101
+ "https://api.github.com/repos/#{owner}/#{repo}/actions/workflows/#{workflow_file}/runs?branch=#{URI.encode_www_form_component(b)}&per_page=5",
102
+ token: token
103
+ )
104
+ return unless data
107
105
 
108
- data = JSON.parse(res.body)
109
106
  runs = Array(data["workflow_runs"]) || []
110
107
  # Try to match by head_sha first; fall back to first run (branch-scoped) if none matches yet.
111
108
  run = if sha
112
109
  match = runs.find { |r| r["head_sha"] == sha }
110
+ match ||= latest_repository_workflow_run(owner: owner, repo: repo, workflow_file: workflow_file, branch: b, head_sha: sha, token: token)
113
111
  require_head ? match : (match || runs.first)
114
112
  else
115
113
  runs.first unless require_head
@@ -128,6 +126,30 @@ module Kettle
128
126
  nil
129
127
  end
130
128
 
129
+ def latest_repository_workflow_run(owner:, repo:, workflow_file:, branch:, head_sha:, token:)
130
+ data = github_get_json(
131
+ "https://api.github.com/repos/#{owner}/#{repo}/actions/runs?branch=#{URI.encode_www_form_component(branch)}&per_page=100",
132
+ token: token
133
+ )
134
+ return unless data
135
+
136
+ workflow_path = ".github/workflows/#{workflow_file}"
137
+ Array(data["workflow_runs"]).find do |run|
138
+ run["head_sha"] == head_sha && run["path"] == workflow_path
139
+ end
140
+ end
141
+
142
+ def github_get_json(url, token:)
143
+ uri = URI(url)
144
+ req = Net::HTTP::Get.new(uri)
145
+ req["User-Agent"] = "kettle-dev/ci-helpers"
146
+ req["Authorization"] = "token #{token}" if token && !token.empty?
147
+ res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
148
+ return unless res.is_a?(Net::HTTPSuccess)
149
+
150
+ JSON.parse(res.body)
151
+ end
152
+
131
153
  # Whether a run has completed successfully.
132
154
  # @param run [Hash, nil]
133
155
  # @return [Boolean]
@@ -352,7 +352,7 @@ module Kettle
352
352
  rescue
353
353
  nil
354
354
  end
355
- (seconds && seconds >= 0) ? seconds : 120
355
+ (seconds && seconds >= 0) ? seconds : 300
356
356
  end
357
357
  module_function :github_start_timeout
358
358
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "version"
4
+
5
+ module Kettle
6
+ module Dev
7
+ module ExecutableVersion
8
+ module_function
9
+
10
+ def print_and_exit!(script_basename, argv, value_option: false)
11
+ return unless requested?(argv, value_option: value_option)
12
+
13
+ puts "#{script_basename} #{Kettle::Dev::Version::VERSION}"
14
+ exit(0)
15
+ end
16
+
17
+ def print_header(script_basename)
18
+ puts header(script_basename)
19
+ end
20
+
21
+ def header(script_basename)
22
+ "== #{script_basename} v#{Kettle::Dev::Version::VERSION} =="
23
+ end
24
+
25
+ def requested?(argv, value_option: false)
26
+ argv.each_with_index.any? do |arg, index|
27
+ arg == "-v" || bare_long_version?(argv, arg, index, value_option: value_option)
28
+ end
29
+ end
30
+
31
+ def bare_long_version?(argv, arg, index, value_option:)
32
+ return false unless arg == "--version"
33
+ return true unless value_option
34
+
35
+ index == argv.length - 1 || argv[index + 1].to_s.start_with?("-")
36
+ end
37
+ end
38
+ end
39
+ end
@@ -375,25 +375,29 @@ module Kettle
375
375
  output: $stdout
376
376
  )
377
377
  failures = []
378
- urls.each do |url|
379
- if image_url_skipped?(url)
380
- skipped << url
381
- progress.skipped
382
- next
383
- end
378
+ begin
379
+ urls.each do |url|
380
+ if image_url_skipped?(url)
381
+ skipped << url
382
+ progress.skipped
383
+ next
384
+ end
384
385
 
385
- if cache && !@refresh_image_url_cache && cache.fresh_success?(url)
386
- progress.cached
387
- next
388
- end
386
+ if cache && !@refresh_image_url_cache && cache.fresh_success?(url)
387
+ progress.cached
388
+ next
389
+ end
389
390
 
390
- ok = HTTP.head_ok?(url)
391
- progress.live
392
- if ok
393
- cache&.write_success(url)
394
- else
395
- failures << url
391
+ ok = HTTP.head_ok?(url)
392
+ progress.live
393
+ if ok
394
+ cache&.write_success(url)
395
+ else
396
+ failures << url
397
+ end
396
398
  end
399
+ ensure
400
+ progress.stop
397
401
  end
398
402
  puts "[kettle-pre-release] Image URL checks: #{progress.cached_count} cached, #{progress.live_count} live."
399
403
  puts "[kettle-pre-release] Skipped #{progress.skipped_count} image URL check(s)." if skipped.any?
@@ -3,7 +3,7 @@
3
3
  module Kettle
4
4
  module Dev
5
5
  module Version
6
- VERSION = "2.3.10"
6
+ VERSION = "2.4.0"
7
7
  end
8
8
  VERSION = Version::VERSION # Traditional Constant Location
9
9
  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: 2.3.10
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -57,20 +57,20 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.2'
60
+ version: '0.3'
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 0.2.1
63
+ version: 0.3.1
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '0.2'
70
+ version: '0.3'
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 0.2.1
73
+ version: 0.3.1
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: kettle-rb
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -125,6 +125,20 @@ dependencies:
125
125
  - - "~>"
126
126
  - !ruby/object:Gem::Version
127
127
  version: '1.13'
128
+ - !ruby/object:Gem::Dependency
129
+ name: tty-progressbar
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '0.18'
135
+ type: :runtime
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '0.18'
128
142
  - !ruby/object:Gem::Dependency
129
143
  name: bundler-audit
130
144
  requirement: !ruby/object:Gem::Requirement
@@ -301,6 +315,7 @@ files:
301
315
  - lib/kettle/dev/ci_monitor.rb
302
316
  - lib/kettle/dev/commit_msg.rb
303
317
  - lib/kettle/dev/dvcs_cli.rb
318
+ - lib/kettle/dev/executable_version.rb
304
319
  - lib/kettle/dev/exit_adapter.rb
305
320
  - lib/kettle/dev/gem_coop_versions.rb
306
321
  - lib/kettle/dev/gem_spec_reader.rb
@@ -334,10 +349,10 @@ licenses:
334
349
  - AGPL-3.0-only
335
350
  metadata:
336
351
  homepage_uri: https://kettle-dev.galtzo.com
337
- source_code_uri: https://github.com/kettle-dev/kettle-dev/tree/v2.3.10
338
- changelog_uri: https://github.com/kettle-dev/kettle-dev/blob/v2.3.10/CHANGELOG.md
352
+ source_code_uri: https://github.com/kettle-dev/kettle-dev/tree/v2.4.0
353
+ changelog_uri: https://github.com/kettle-dev/kettle-dev/blob/v2.4.0/CHANGELOG.md
339
354
  bug_tracker_uri: https://github.com/kettle-dev/kettle-dev/issues
340
- documentation_uri: https://www.rubydoc.info/gems/kettle-dev/2.3.10
355
+ documentation_uri: https://www.rubydoc.info/gems/kettle-dev/2.4.0
341
356
  funding_uri: https://github.com/sponsors/pboling
342
357
  wiki_uri: https://github.com/kettle-dev/kettle-dev/wiki
343
358
  news_uri: https://www.railsbling.com/tags/kettle-dev
metadata.gz.sig CHANGED
Binary file