resurrected_god 1.1.1 → 1.1.2

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: e65b14e71958dd94729eeba93780283ccdb73e49a202859d816b94832656436f
4
- data.tar.gz: 9a32895548e3f07d7a0e0f0907475d20217da6fe58e2227fcc5c852644b968b4
3
+ metadata.gz: c7465cd872f35560c971fa2a4a0d1571b37129d7012d309f9e76b37bdb4e07e4
4
+ data.tar.gz: 33fec16027eaccb0df55a0895ea139ceed978e98f8c868596e00bfa2ca87bff1
5
5
  SHA512:
6
- metadata.gz: 37610457947e042fbeaa46aca0087b5f8cf022188ad9049c0512decf13136a879f19b8993da7ace3035dd574163d94fdd2ffb63bb148ab13513aaa45bcb29044
7
- data.tar.gz: f0cc1a3ffc8a58c0c6b5285a30134a6a4657ed7479913b4bcfd66ebaf7978eba1aaf2ac3a409543ecf17caf84b872e48fa16b841056b56a07aa33eaadbcd4e3d
6
+ metadata.gz: 0ef0c4e6171d31c292a8f9b76f7d813f434c31de284a6fef9fafe947226c807d5110f7e604dd1fc950d9f33c35cd4bd3c485c00e9498ccb51942915829d1dbb3
7
+ data.tar.gz: 2c831bfd22c3887c9445fe22d15eb6ccfb3787b3b61bdbf40170e6497b305704d6dfac5cb897f72a5b7e4a5e7f8d2890675cb481e7e7e13cde13467e62d57c63
data/History.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.1.2 / 2026-11-18
2
+
3
+ * Bug fixes
4
+ * Fix compilation errors with GCC 15 ([@dsander][])
5
+
1
6
  ## 1.1.1 / 2023-12-29
2
7
 
3
8
  * Minor Changes
@@ -63,8 +63,9 @@ kqh_monitor_process(VALUE klass, VALUE pid, VALUE mask)
63
63
  }
64
64
 
65
65
  VALUE
66
- kqh_handle_events()
66
+ kqh_handle_events(VALUE klass)
67
67
  {
68
+ (void)klass;
68
69
  int nevents, i, num_to_fetch;
69
70
  struct kevent *events;
70
71
 
@@ -29,8 +29,9 @@ static int nl_sock; /* socket for netlink connection */
29
29
 
30
30
 
31
31
  VALUE
32
- nlh_handle_events()
32
+ nlh_handle_events(VALUE klass)
33
33
  {
34
+ (void)klass;
34
35
  char buff[CONNECTOR_MAX_MSG_SIZE];
35
36
  struct nlmsghdr *hdr;
36
37
  struct proc_event *event;
data/lib/god/cli/run.rb CHANGED
@@ -111,13 +111,13 @@ module God
111
111
  def setup_logging
112
112
  log_file = God.log_file
113
113
  log_file = File.expand_path(@options[:log]) if @options[:log]
114
- log_file = '/dev/null' if !log_file && @options[:daemonize]
114
+ log_file = File::NULL if !log_file && @options[:daemonize]
115
115
  return unless log_file
116
116
 
117
117
  puts "Sending output to log file: #{log_file}" unless @options[:daemonize]
118
118
 
119
119
  # reset file descriptors
120
- $stdin.reopen '/dev/null'
120
+ $stdin.reopen File::NULL
121
121
  $stdout.reopen(log_file, 'a')
122
122
  $stderr.reopen $stdout
123
123
  $stdout.sync = true
@@ -64,15 +64,15 @@ module God
64
64
  # nil @this here by initially setting res to true or false,
65
65
  # depending on whether the first operator used is AND or OR
66
66
  # respectively.
67
- @op_stack[0] & AND > 0
67
+ @op_stack[0].anybits?(AND)
68
68
  else
69
69
  @this.test
70
70
  end
71
71
 
72
72
  @op_stack.each do |op|
73
73
  cond = @oper_stack.shift
74
- value = op & NOT > 0 ? !cond.test : cond.test
75
- if op & AND > 0
74
+ value = op.anybits?(NOT) ? !cond.test : cond.test
75
+ if op.anybits?(AND)
76
76
  res &&= value
77
77
  else
78
78
  res ||= value
@@ -64,7 +64,7 @@ module God
64
64
  @timeline.push(process.percent_cpu)
65
65
  self.info = []
66
66
 
67
- history = @timeline.map { |x| "#{x > above ? '*' : ''}#{x}%%" }.join(', ')
67
+ history = @timeline.map { |x| "#{'*' if x > above}#{x}%%" }.join(', ')
68
68
 
69
69
  if @timeline.count { |x| x > above } >= times.first
70
70
  self.info = "cpu out of bounds [#{history}]"
@@ -66,7 +66,7 @@ module God
66
66
  @timeline.push(process.memory)
67
67
  self.info = []
68
68
 
69
- history = @timeline.map { |x| "#{x > above ? '*' : ''}#{x}kb" }.join(', ')
69
+ history = @timeline.map { |x| "#{'*' if x > above}#{x}kb" }.join(', ')
70
70
 
71
71
  if @timeline.count { |x| x > above } >= times.first
72
72
  self.info = "memory out of bounds [#{history}]"
data/lib/god/contact.rb CHANGED
@@ -47,7 +47,7 @@ module God
47
47
  when String
48
48
  { contacts: Array(spec) }
49
49
  when Array
50
- raise ArgumentError, 'contains non-String elements' unless spec.all? { |x| x.instance_of?(String) }
50
+ raise ArgumentError, 'contains non-String elements' unless spec.all?(String)
51
51
 
52
52
  { contacts: spec }
53
53
  when Hash
@@ -60,7 +60,7 @@ module God
60
60
  when String
61
61
  # valid
62
62
  when Array
63
- raise ArgumentError, 'has a :contacts key containing non-String elements' unless contacts.all? { |x| x.instance_of?(String) }
63
+ raise ArgumentError, 'has a :contacts key containing non-String elements' unless contacts.all?(String)
64
64
  # valid
65
65
  else
66
66
  raise ArgumentError, 'must have a :contacts key pointing to a String or Array of Strings'
data/lib/god/logger.rb CHANGED
@@ -12,7 +12,7 @@ module God
12
12
 
13
13
  # Instantiate a new Logger object
14
14
  def initialize(io = $stdout)
15
- super(io)
15
+ super
16
16
  self.logs = {}
17
17
  @mutex = Mutex.new
18
18
  @capture = nil
@@ -24,7 +24,7 @@ module God
24
24
 
25
25
  def level=(lev)
26
26
  SysLogger.level = SimpleLogger::CONSTANT_TO_SYMBOL[lev] if Logger.syslog
27
- super(lev)
27
+ super
28
28
  end
29
29
 
30
30
  # Log a message
data/lib/god/process.rb CHANGED
@@ -9,7 +9,7 @@ module God
9
9
  :stop_timeout, :stop_signal, :umask
10
10
 
11
11
  def initialize
12
- self.log = '/dev/null'
12
+ self.log = File::NULL
13
13
 
14
14
  @pid_file = nil
15
15
  @tracking_pid = true
@@ -139,7 +139,7 @@ module God
139
139
  applog(self, :error, "CHROOT directory '#{chroot}' does not exist")
140
140
  end
141
141
 
142
- unless File.exist?(File.join(chroot, '/dev/null'))
142
+ unless File.exist?(File.join(chroot, File::NULL))
143
143
  valid = false
144
144
  applog(self, :error, "CHROOT directory '#{chroot}' does not contain '/dev/null'")
145
145
  end
@@ -309,9 +309,9 @@ module God
309
309
  ::Process::Sys.setgid(gid_num) if gid_num
310
310
  ::Process::Sys.setuid(uid_num) if uid
311
311
  self.dir ||= '/'
312
- Dir.chdir self.dir
312
+ Dir.chdir dir
313
313
  $0 = command
314
- $stdin.reopen '/dev/null'
314
+ $stdin.reopen File::NULL
315
315
  if log_cmd
316
316
  $stdout.reopen IO.popen(log_cmd, 'a')
317
317
  else
@@ -22,7 +22,7 @@ module God
22
22
  end
23
23
 
24
24
  def initialize(pid)
25
- super(pid)
25
+ super
26
26
  return if @@total_mem
27
27
 
28
28
  # in K
data/lib/god/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module God
4
4
  # The String version number for this package.
5
- VERSION = '1.1.1'
5
+ VERSION = '1.1.2'
6
6
  end
data/lib/god/watch.rb CHANGED
@@ -27,6 +27,7 @@ module God
27
27
 
28
28
  # Public: God::Process delegators. See lib/god/process.rb for docs.
29
29
  extend Forwardable
30
+
30
31
  def_delegators :@process, :name, :uid, :gid, :start, :stop, :restart, :dir,
31
32
  :name=, :uid=, :gid=, :start=, :stop=, :restart=,
32
33
  :dir=, :pid_file, :pid_file=, :log, :log=,
data/lib/god.rb CHANGED
@@ -243,7 +243,7 @@ if $load_god
243
243
  warn: Logger::WARN,
244
244
  error: Logger::ERROR,
245
245
  fatal: Logger::FATAL }
246
- LOG.level = log_level_map[self.log_level]
246
+ LOG.level = log_level_map[log_level]
247
247
 
248
248
  # Init has been executed.
249
249
  self.inited = true
@@ -514,8 +514,7 @@ if $load_god
514
514
  # Returns an Array of String names of the tasks affected.
515
515
  def self.signal(name, signal)
516
516
  items = watches_by_name(name)
517
- jobs = []
518
- items.each { |w| jobs << Thread.new { w.signal(signal) } }
517
+ jobs = items.map { |w| Thread.new { w.signal(signal) } }
519
518
  jobs.each(&:join)
520
519
  items.map(&:name)
521
520
  end
@@ -676,7 +675,7 @@ if $load_god
676
675
  internal_init
677
676
 
678
677
  # Instantiate server.
679
- self.server = Socket.new(self.port, socket_user, socket_group, socket_perms)
678
+ self.server = Socket.new(port, socket_user, socket_group, socket_perms)
680
679
 
681
680
  # Start monitoring any watches set to autostart.
682
681
  watches.each_value { |w| w.monitor if w.autostart? }
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resurrected_god
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  - Kevin Clark
9
9
  - Eric Lindvall
10
10
  - mishina2228
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2023-12-29 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: drb
@@ -119,8 +118,7 @@ metadata:
119
118
  changelog_uri: https://github.com/mishina2228/resurrected_god/blob/master/History.md
120
119
  homepage_uri: https://github.com/mishina2228/resurrected_god
121
120
  rubygems_mfa_required: 'true'
122
- source_code_uri: https://github.com/mishina2228/resurrected_god/tree/v1.1.1
123
- post_install_message:
121
+ source_code_uri: https://github.com/mishina2228/resurrected_god/tree/v1.1.2
124
122
  rdoc_options: []
125
123
  require_paths:
126
124
  - lib
@@ -136,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
134
  - !ruby/object:Gem::Version
137
135
  version: '0'
138
136
  requirements: []
139
- rubygems_version: 3.4.10
140
- signing_key:
137
+ rubygems_version: 4.0.3
141
138
  specification_version: 4
142
139
  summary: Process monitoring framework.
143
140
  test_files: []