kennel 1.153.0 → 1.155.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: 494943be7e89773e54b07cafc41725e946bbc2c4038315ce21b123515c4561de
4
- data.tar.gz: f9ae76c8cc4a83d04f41c44abb4eb8fee2aefc85f60ee6376de1fcd8e639cdee
3
+ metadata.gz: 52d3ae07f004122c89830d62abf500f176f764bda7848dc3bf10094632f81172
4
+ data.tar.gz: c64b314848c4574326f8d485e4fe6849c53e03a7cf38871e86a2d89cf43cbd0e
5
5
  SHA512:
6
- metadata.gz: 156d4655d75c82ddac1ac80dad4cd1d480c3a7c277c1bcc115a887c7c6d6b653daf7f73deaa7e42fc46a0a79e1bbc2102acb7e4ffa86c08ab7ce14cbdd9270e9
7
- data.tar.gz: fde6bf6493035c908ada35545f4666cf7a7c81090dfef315384180d904f6c904d13dc4e5f47c84b33d21d21bfd851efd4e70542c22a19fdc96233898284552f3
6
+ metadata.gz: 9e2a7327e64c318fe1ac443d5157ffd4e0a65a298b56e7a5345cc15ed2f472f09b4a4387c97599633d2357f6d9fc26317a218cfa2e48ab87c0db5a18e0365740
7
+ data.tar.gz: ae76d3d79ec245ee127266a6ed402766370354a11bc78952a162e001c9bd53037620996524c2e24544d9ac3199df607aee60ff4ed72b320985e2d4fca530bfbb
@@ -15,6 +15,10 @@ module Kennel
15
15
  end
16
16
 
17
17
  class << self
18
+ def tty?
19
+ !ENV["CI"] && (Kennel.in.tty? || Kennel.err.tty?)
20
+ end
21
+
18
22
  def ask?(question)
19
23
  Kennel.err.printf color(:red, "#{question} - press 'y' to continue: ", force: true)
20
24
  begin
@@ -141,8 +141,9 @@ module Kennel
141
141
  options[:renotify_statuses] = statuses
142
142
  end
143
143
 
144
- # for events: on_missing_data cannot be used with notify_no_data or no_data_timeframe
145
- if data.fetch(:type) == "event-v2 alert"
144
+ # on_missing_data cannot be used with notify_no_data or no_data_timeframe
145
+ # TODO migrate everything to only use on_missing_data
146
+ if data.fetch(:type) == "event-v2 alert" || on_missing_data != "default"
146
147
  options[:on_missing_data] = on_missing_data
147
148
  options[:notify_no_data] = false # cannot set nil or it's an endless update loop
148
149
  options.delete :no_data_timeframe
@@ -25,7 +25,8 @@ module Kennel
25
25
 
26
26
  # TODO: also auto-load projects and update expected path too
27
27
  ["projects"].each do |folder|
28
- Dir["#{folder}/**/*.rb"].each { |f| require "./#{f}" }
28
+ # we need the extra sort so foo/bar.rb is loaded before foo/bar/baz.rb
29
+ Dir["#{folder}/**/*.rb"].sort.each { |f| require "./#{f}" } # rubocop:disable Lint/RedundantDirGlobSort
29
30
  end
30
31
  rescue NameError => e
31
32
  message = e.message
data/lib/kennel/syncer.rb CHANGED
@@ -29,7 +29,7 @@ module Kennel
29
29
 
30
30
  def confirm
31
31
  return false if plan.empty?
32
- return true if ENV["CI"] || !Kennel.in.tty? || !Kennel.err.tty?
32
+ return true unless Console.tty?
33
33
  Console.ask?("Execute Plan ?")
34
34
  end
35
35
 
@@ -66,6 +66,11 @@ module Kennel
66
66
  changes << item.change
67
67
  Kennel.out.puts "#{LINE_UP}Updated #{message}"
68
68
  end
69
+ rescue StandardError
70
+ raise unless Console.tty?
71
+ Kennel.err.puts $!.message
72
+ Kennel.err.puts $!.backtrace
73
+ raise unless Console.ask?("Continue with error ?")
69
74
  end
70
75
 
71
76
  plan.changes = changes
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.153.0"
3
+ VERSION = "1.155.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.153.0
4
+ version: 1.155.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-12 00:00:00.000000000 Z
11
+ date: 2025-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs