zeus 0.17.0 → 0.19.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: 7fe602725abd18a98be2f3943a3dcceed5ab4b7a015143b8c43718284bc64a38
4
- data.tar.gz: cfa868f58d797feb34c52030ad3af8a57aa1468898e68051734187cdc9fbf9a5
3
+ metadata.gz: 13ba0d18d21cd3acc6d3ea8ce209284a38317d792fbddf6e3bc4d96ea7b08f2e
4
+ data.tar.gz: 060fae4a6cb9af9719fa3afeb8c547e6284d9c6f0a06ffa2c9ee2cc3a33d76a0
5
5
  SHA512:
6
- metadata.gz: 349d3ad88b447e272b53e60682ffefc4f42af6d8c710b6c38bd1411081358f6e1d03c2344a3eb3df22eb4f43936c9b20feb9056ba017bd0a55edae7b4946f56b
7
- data.tar.gz: 1f256c06b1e70fba130a652597a6c7b3ad56636b643263b749a491ad46802421005d74680653bb814d972f65f7cf5e490b63d30b53427a13936a07dfc637a000
6
+ metadata.gz: b5da808dc2e3e2a28655e65a0f8ec30b9bff990d0e3ed2b53a6fd7c1df860b7e328faa88566d6acc6832846296b21e55f2717ee0678d1b68e1d5b92fb61aedc0
7
+ data.tar.gz: 584ae657a69d7ebb8d2a6529ffcbb4051ab5365615c31ec36549505bdd9000daa8fc3be658c4512d9ef91108c0133b73f1a5572c1de55f413e40c6083c2c498d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zeus (0.17.0)
4
+ zeus (0.19.0)
5
5
  method_source (>= 0.6.7)
6
6
 
7
7
  GEM
@@ -29,6 +29,7 @@ GEM
29
29
  rspec-support (3.12.1)
30
30
 
31
31
  PLATFORMS
32
+ arm64-darwin-24
32
33
  x86_64-darwin-22
33
34
  x86_64-darwin-23
34
35
 
data/build/zeus-darwin ADDED
Binary file
Binary file
Binary file
data/build/zeus-linux-386 CHANGED
Binary file
Binary file
@@ -53,15 +53,19 @@ module Zeus
53
53
  private
54
54
 
55
55
  def notify_features(features)
56
- unless @feature_pipe
57
- raise "Attempted to report features to Zeus when not running as part of a Zeus process"
58
- end
56
+ return unless @feature_pipe
59
57
 
60
58
  @feature_mutex.synchronize do
61
59
  features.each do |t|
62
60
  @feature_pipe.puts(t)
61
+ rescue Errno::EPIPE, Errno::EBADF, IOError
62
+ break
63
63
  end
64
64
  end
65
+ rescue Errno::EPIPE, Errno::EBADF, IOError
66
+ # Feature pipe is broken; skip tracking. This must not raise because
67
+ # notify_features is called from ensure blocks and an exception here
68
+ # would replace the original exception being propagated.
65
69
  end
66
70
  end
67
71
  end
data/lib/zeus/rails.rb CHANGED
@@ -9,6 +9,24 @@ ENV_PATH = File.expand_path('config/environment', RAILS_PATH)
9
9
  BOOT_PATH = File.expand_path('config/boot', RAILS_PATH)
10
10
  APP_PATH = File.expand_path('config/application', RAILS_PATH) unless defined? APP_PATH
11
11
 
12
+ # Set up Bundler's gem environment before loading any gems to prevent version
13
+ # conflicts (e.g. default gem versions conflicting with the app's Gemfile).
14
+ # We must do this before `require 'zeus'` so that gems like json/ostruct are
15
+ # activated at the Gemfile-pinned versions from the start.
16
+ #
17
+ # Bundler#setup may strip zeus's own lib path from $LOAD_PATH if zeus isn't
18
+ # listed in the app's Gemfile, so we capture it first and restore it after.
19
+ _zeus_lib_path = File.expand_path('../../', __FILE__)
20
+ begin
21
+ require 'bundler/setup'
22
+ rescue LoadError
23
+ # Bundler not installed; continue without it.
24
+ rescue => e
25
+ # Bundler setup failed (e.g. no Gemfile, gem conflict); continue without it.
26
+ ensure
27
+ $LOAD_PATH.unshift(_zeus_lib_path) unless $LOAD_PATH.include?(_zeus_lib_path)
28
+ end
29
+
12
30
  require 'zeus'
13
31
 
14
32
  def gem_is_bundled?(gem)
@@ -76,10 +94,10 @@ module Zeus
76
94
  end
77
95
 
78
96
  def boot
79
- _monkeypatch_rake
80
97
  $LOAD_PATH.unshift "./lib"
81
98
 
82
99
  require BOOT_PATH
100
+ _monkeypatch_rake
83
101
  # config/application.rb normally requires 'rails/all'.
84
102
  # Some 'alternative' ORMs such as Mongoid give instructions to switch this require
85
103
  # out for a list of railties, not including ActiveRecord.
data/lib/zeus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zeus
2
- VERSION = "0.17.0"
2
+ VERSION = "0.19.0"
3
3
  end
data/lib/zeus.rb CHANGED
@@ -187,12 +187,16 @@ module Zeus
187
187
 
188
188
  def report_error_to_master(local, error)
189
189
  str = "R:"
190
- str << "#{error.backtrace[0]}: #{error.message} (#{error.class})\n"
191
- error.backtrace[1..-1].each do |line|
190
+ backtrace = error.backtrace || []
191
+ str << "#{backtrace[0] || '(no backtrace)'}: #{error.message} (#{error.class})\n"
192
+ backtrace[1..-1].each do |line|
192
193
  str << "\tfrom #{line}\n"
193
194
  end
194
195
  str << "\0"
195
196
  local.write str
197
+ rescue Exception
198
+ # If building or writing the error message itself fails, there is nothing
199
+ # we can do — the master will see EOF and mark the slave as crashed.
196
200
  end
197
201
 
198
202
  def run_action(socket, identifier)
@@ -204,7 +208,7 @@ module Zeus
204
208
  end
205
209
 
206
210
  socket.write "R:OK\0"
207
- rescue => err
211
+ rescue Exception => err
208
212
  report_error_to_master(socket, err)
209
213
  raise
210
214
  end
data/zeus-0.17.0.gem ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: method_source
@@ -54,6 +53,7 @@ files:
54
53
  - bin/rake
55
54
  - bin/rspec
56
55
  - bin/zeus
56
+ - build/zeus-darwin
57
57
  - build/zeus-darwin-amd64
58
58
  - build/zeus-darwin-arm64
59
59
  - build/zeus-linux-386
@@ -91,12 +91,12 @@ files:
91
91
  - spec/m_spec.rb
92
92
  - spec/rails_spec.rb
93
93
  - spec/zeus_spec.rb
94
+ - zeus-0.17.0.gem
94
95
  - zeus.gemspec
95
96
  homepage: https://github.com/burke/zeus
96
97
  licenses:
97
98
  - MIT
98
99
  metadata: {}
99
- post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
@@ -111,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.4.19
115
- signing_key:
114
+ rubygems_version: 3.6.9
116
115
  specification_version: 4
117
116
  summary: Zeus is an intelligent preloader for ruby applications. It allows normal
118
117
  development tasks to be run in a fraction of a second.