zeus 0.16.0 → 0.18.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 +4 -4
- data/Gemfile.lock +3 -1
- data/build/zeus-darwin-amd64 +0 -0
- data/build/zeus-darwin-arm64 +0 -0
- data/build/zeus-linux-386 +0 -0
- data/build/zeus-linux-amd64 +0 -0
- data/lib/zeus/load_tracking.rb +9 -5
- data/lib/zeus/m.rb +1 -1
- data/lib/zeus/rails.rb +23 -5
- data/lib/zeus/version.rb +1 -1
- data/lib/zeus.rb +7 -3
- data/spec/rails_spec.rb +1 -1
- data/zeus-0.17.0.gem +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a6d45ec7899f6f3608e686da81cd443cffd058aca885759799185d2fc649fee
|
|
4
|
+
data.tar.gz: e5d033171d13916defb233555f17822611225e962d985b2f366015a9844eb20f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 60355aaca66db85f170bf4e6191bd1c7313c87bcf8a30722490f905708f40d1c174a3cc381e57310c9da6b177b2c47c4a53d31b6730868508cc30e6606251537
|
|
7
|
+
data.tar.gz: f6dc19bb8a9f56dd9da996664bb488d481848a4a4178623bfe320bf74871ae9a884bde89eb9277cf8bc31690f291d392125d7ccfb05ca3ce88a47424485790b9
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zeus (0.
|
|
4
|
+
zeus (0.18.0)
|
|
5
5
|
method_source (>= 0.6.7)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -29,7 +29,9 @@ GEM
|
|
|
29
29
|
rspec-support (3.12.1)
|
|
30
30
|
|
|
31
31
|
PLATFORMS
|
|
32
|
+
arm64-darwin-24
|
|
32
33
|
x86_64-darwin-22
|
|
34
|
+
x86_64-darwin-23
|
|
33
35
|
|
|
34
36
|
DEPENDENCIES
|
|
35
37
|
bundler (~> 2.3)
|
data/build/zeus-darwin-amd64
CHANGED
|
Binary file
|
data/build/zeus-darwin-arm64
CHANGED
|
Binary file
|
data/build/zeus-linux-386
CHANGED
|
Binary file
|
data/build/zeus-linux-amd64
CHANGED
|
Binary file
|
data/lib/zeus/load_tracking.rb
CHANGED
|
@@ -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
|
|
@@ -88,9 +92,9 @@ require 'yaml'
|
|
|
88
92
|
module YAML
|
|
89
93
|
class << self
|
|
90
94
|
alias_method :__load_file_without_zeus, :load_file
|
|
91
|
-
def load_file(file,
|
|
95
|
+
def load_file(file, **kwargs)
|
|
92
96
|
Zeus::LoadTracking.add_feature(file)
|
|
93
|
-
__load_file_without_zeus(file,
|
|
97
|
+
__load_file_without_zeus(file, **kwargs)
|
|
94
98
|
end
|
|
95
99
|
end
|
|
96
100
|
end
|
data/lib/zeus/m.rb
CHANGED
|
@@ -10,7 +10,7 @@ require "zeus/m/test_method"
|
|
|
10
10
|
# To avoid possible "you've activated X; gemfile specifies Y" errors, we actually scan
|
|
11
11
|
# Gemfile.lock for a specific version, and require exactly that version if present.
|
|
12
12
|
gemfile_lock = ROOT_PATH + "/Gemfile.lock"
|
|
13
|
-
if File.
|
|
13
|
+
if File.exist?(gemfile_lock)
|
|
14
14
|
version = File.read(ROOT_PATH + "/Gemfile.lock").
|
|
15
15
|
scan(/\bmethod_source\s*\(([\d\.]+)\)/).flatten[0]
|
|
16
16
|
|
data/lib/zeus/rails.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
def find_rails_path(root_path)
|
|
2
2
|
paths = %w(spec/dummy test/dummy .)
|
|
3
|
-
paths.find { |path| File.
|
|
3
|
+
paths.find { |path| File.exist?(File.expand_path(path, root_path)) }
|
|
4
4
|
end
|
|
5
5
|
|
|
6
6
|
ROOT_PATH = File.expand_path(Dir.pwd)
|
|
@@ -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.
|
|
@@ -210,13 +228,13 @@ module Zeus
|
|
|
210
228
|
if ENV['RAILS_TEST_HELPER']
|
|
211
229
|
require ENV['RAILS_TEST_HELPER']
|
|
212
230
|
else
|
|
213
|
-
if File.
|
|
231
|
+
if File.exist?(ROOT_PATH + "/spec/rails_helper.rb")
|
|
214
232
|
# RSpec >= 3.0+
|
|
215
233
|
require 'rails_helper'
|
|
216
|
-
elsif File.
|
|
234
|
+
elsif File.exist?(ROOT_PATH + "/spec/spec_helper.rb")
|
|
217
235
|
# RSpec < 3.0
|
|
218
236
|
require 'spec_helper'
|
|
219
|
-
elsif File.
|
|
237
|
+
elsif File.exist?(ROOT_PATH + "/test/minitest_helper.rb")
|
|
220
238
|
require 'minitest_helper'
|
|
221
239
|
else
|
|
222
240
|
require 'test_helper'
|
data/lib/zeus/version.rb
CHANGED
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
|
-
|
|
191
|
-
|
|
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/spec/rails_spec.rb
CHANGED
data/zeus-0.17.0.gem
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zeus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Burke Libbey
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: method_source
|
|
@@ -91,6 +91,7 @@ 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:
|
|
@@ -111,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
111
112
|
- !ruby/object:Gem::Version
|
|
112
113
|
version: '0'
|
|
113
114
|
requirements: []
|
|
114
|
-
rubygems_version: 3.
|
|
115
|
+
rubygems_version: 3.5.22
|
|
115
116
|
signing_key:
|
|
116
117
|
specification_version: 4
|
|
117
118
|
summary: Zeus is an intelligent preloader for ruby applications. It allows normal
|