zeus 0.15.14 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5a20f52042da7071acb34efb173a4688c41e8f9e
4
- data.tar.gz: d64e011fd6bf6e1d1da2590e7f0d59b88a5e46d1
2
+ SHA256:
3
+ metadata.gz: b6763099ec0acd75e736c7dac93c0b085096cc62ef64716be3c8503eab4f489e
4
+ data.tar.gz: 54f4f6d0316bcedebecdb02e45e1d4c6a953db52ef63d776c2d6c581e83cada7
5
5
  SHA512:
6
- metadata.gz: 1221de2bc9f105d833f0ffe7ba9846dff06118d28a27f1ea6c1453dc7e7540519fd10987784a99ab9ed527791fb05db48d35bbce8721b0a9ef2209244f2a70b8
7
- data.tar.gz: 976f2f98663ae05fabc2731e74dfe7d084c223ddb54c81614aa1959f1ae356a72c8ce9ba65aa64f0052d9eda59b0fefdc8bbcc198939c608e0c060aff1ee9fc1
6
+ metadata.gz: 4e0cdbd5348ab0dbb3bbf3154a2b9743266d7001ec4688df0516eb48593d7a0366686f6df6bbe2d945d7b7eb0c604985f62a8d5d96622e513a56806cba6890f5
7
+ data.tar.gz: 98d7c5c3c7f2095238c77ae049a5c94f9bd525cb8e58fb3a2238018a5ac832954a5e32a2b4fa65687feccf8f00b78f1c4ea39592746b7b6646e286014cacf2cd
data/Gemfile.lock CHANGED
@@ -1,44 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zeus (0.15.14)
4
+ zeus (0.16.0)
5
5
  method_source (>= 0.6.7)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- coderay (1.1.1)
11
- diff-lcs (1.2.5)
12
- method_source (0.8.2)
13
- pry (0.10.4)
14
- coderay (~> 1.1.0)
15
- method_source (~> 0.8.1)
16
- slop (~> 3.4)
17
- rake (12.0.0)
18
- rspec (3.5.0)
19
- rspec-core (~> 3.5.0)
20
- rspec-expectations (~> 3.5.0)
21
- rspec-mocks (~> 3.5.0)
22
- rspec-core (3.5.4)
23
- rspec-support (~> 3.5.0)
24
- rspec-expectations (3.5.0)
10
+ coderay (1.1.3)
11
+ diff-lcs (1.5.0)
12
+ method_source (1.0.0)
13
+ pry (0.14.2)
14
+ coderay (~> 1.1)
15
+ method_source (~> 1.0)
16
+ rake (13.0.6)
17
+ rspec (3.12.0)
18
+ rspec-core (~> 3.12.0)
19
+ rspec-expectations (~> 3.12.0)
20
+ rspec-mocks (~> 3.12.0)
21
+ rspec-core (3.12.2)
22
+ rspec-support (~> 3.12.0)
23
+ rspec-expectations (3.12.3)
25
24
  diff-lcs (>= 1.2.0, < 2.0)
26
- rspec-support (~> 3.5.0)
27
- rspec-mocks (3.5.0)
25
+ rspec-support (~> 3.12.0)
26
+ rspec-mocks (3.12.5)
28
27
  diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.5.0)
30
- rspec-support (3.5.0)
31
- slop (3.6.0)
28
+ rspec-support (~> 3.12.0)
29
+ rspec-support (3.12.1)
32
30
 
33
31
  PLATFORMS
34
- ruby
32
+ x86_64-darwin-22
35
33
 
36
34
  DEPENDENCIES
37
- bundler (~> 1.6)
35
+ bundler (~> 2.3)
38
36
  pry (~> 0.10)
39
37
  rake
40
38
  rspec (~> 3.1)
41
39
  zeus!
42
40
 
43
41
  BUNDLED WITH
44
- 1.13.7
42
+ 2.4.12
data/bin/zeus CHANGED
@@ -2,9 +2,10 @@
2
2
  platform = `uname -sm`
3
3
 
4
4
  exe = case platform
5
- when /^Darwin/ ; "zeus-darwin-amd64"
6
- when /^Linux.*64/ ; "zeus-linux-amd64"
7
- when /^Linux.*/ ; "zeus-linux-386"
5
+ when /^Darwin.*arm64/; "zeus-darwin-arm64"
6
+ when /^Darwin/ ; "zeus-darwin-amd64"
7
+ when /^Linux.*64/ ; "zeus-linux-amd64"
8
+ when /^Linux.*/ ; "zeus-linux-386"
8
9
  else
9
10
  puts "Zeus is not supported on your platform."
10
11
  puts "It's not likely to ever be possible on Windows."
Binary file
Binary file
data/build/zeus-linux-386 CHANGED
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  {
2
- "command": "ruby -rubygems -r./custom_plan -eZeus.go",
2
+ "command": "ruby -rrubygems -r./custom_plan -eZeus.go",
3
3
 
4
4
  "plan": {
5
5
  "boot": {
data/examples/zeus.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "command": "ruby -rubygems -rzeus/rails -eZeus.go",
2
+ "command": "ruby -rrubygems -rzeus/rails -eZeus.go",
3
3
 
4
4
  "plan": {
5
5
  "boot": {
data/lib/zeus/pry.rb CHANGED
@@ -1,13 +1,12 @@
1
- begin
2
- require "pry"
3
-
1
+ # Only patch Pry if it is loaded by the app.
2
+ if defined?(Pry::Pager)
4
3
  class Pry::Pager
5
4
  def best_available
5
+ # Versions of Pry prior to 0.13 define `Pry::Pager#_pry_`
6
+ # while versions after that define `Pry::Pager#pry_instance`
7
+ pry = defined?(pry_instance) ? pry_instance : _pry_
6
8
  # paging does not work in zeus so disable it
7
- NullPager.new(_pry_.output)
9
+ NullPager.new(pry.output)
8
10
  end
9
11
  end
10
-
11
- rescue LoadError => e
12
- # pry is not available, so no need to patch it
13
12
  end
data/lib/zeus/rails.rb CHANGED
@@ -95,6 +95,7 @@ module Zeus
95
95
 
96
96
  def default_bundle
97
97
  Bundler.require(:default)
98
+ require 'zeus/pry' if defined?(Pry)
98
99
  Zeus::LoadTracking.add_feature('./Gemfile.lock')
99
100
  end
100
101
 
@@ -115,56 +116,81 @@ module Zeus
115
116
 
116
117
  def generate
117
118
  load_rails_generators
118
- require 'rails/commands/generate'
119
+
120
+ if rails_5_1_or_higher?
121
+ run_rails_5_1_or_higher_command('generate')
122
+ else
123
+ require 'rails/commands/generate'
124
+ end
125
+
119
126
  end
120
127
 
121
128
  def destroy
122
129
  load_rails_generators
123
- require 'rails/commands/destroy'
130
+ if rails_5_1_or_higher?
131
+ run_rails_5_1_or_higher_command('destroy')
132
+ else
133
+ require 'rails/commands/destroy'
134
+ end
124
135
  end
125
136
 
126
137
  def runner
127
- require 'rails/commands/runner'
138
+ if rails_5_1_or_higher?
139
+ run_rails_5_1_or_higher_command('runner')
140
+ else
141
+ require 'rails/commands/runner'
142
+ end
128
143
  end
129
144
 
130
145
  def console
131
- require 'rails/commands/console'
132
-
133
- if defined?(Pry)
134
- # Adding Rails Console helpers to Pry.
135
- if (3..4).include?(::Rails::VERSION::MAJOR)
136
- require 'rails/console/app'
137
- require 'rails/console/helpers'
138
- TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
139
- end
140
-
141
- Pry.start
146
+ if rails_5_1_or_higher?
147
+ run_rails_5_1_or_higher_command('console')
142
148
  else
143
- ::Rails::Console.start(::Rails.application)
149
+ require 'rails/commands/console'
150
+ if defined?(Pry)
151
+ # Adding Rails Console helpers to Pry.
152
+ if (3..4).include?(::Rails::VERSION::MAJOR)
153
+ require 'rails/console/app'
154
+ require 'rails/console/helpers'
155
+ TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
156
+ end
157
+
158
+ Pry.start
159
+ else
160
+ ::Rails::Console.start(::Rails.application)
161
+ end
144
162
  end
145
163
  end
146
164
 
147
165
  def dbconsole
148
- require 'rails/commands/dbconsole'
166
+ if rails_5_1_or_higher?
167
+ run_rails_5_1_or_higher_command('dbconsole')
168
+ else
169
+ require 'rails/commands/dbconsole'
149
170
 
150
- meth = ::Rails::DBConsole.method(:start)
171
+ meth = ::Rails::DBConsole.method(:start)
151
172
 
152
- # `Rails::DBConsole.start` has been changed to load faster in
153
- # https://github.com/rails/rails/commit/346bb018499cde6699fcce6c68dd7e9be45c75e1
154
- #
155
- # This will work with both versions.
156
- if meth.arity.zero?
157
- ::Rails::DBConsole.start
158
- else
159
- ::Rails::DBConsole.start(::Rails.application)
173
+ # `Rails::DBConsole.start` has been changed to load faster in
174
+ # https://github.com/rails/rails/commit/346bb018499cde6699fcce6c68dd7e9be45c75e1
175
+ #
176
+ # This will work with both versions.
177
+ if meth.arity.zero?
178
+ ::Rails::DBConsole.start
179
+ else
180
+ ::Rails::DBConsole.start(::Rails.application)
181
+ end
160
182
  end
161
183
  end
162
184
 
163
185
  def server
164
- require 'rails/commands/server'
165
- server = ::Rails::Server.new
166
- Dir.chdir(::Rails.application.root)
167
- server.start
186
+ if rails_5_1_or_higher?
187
+ run_rails_5_1_or_higher_command('server')
188
+ else
189
+ require 'rails/commands/server'
190
+ server = ::Rails::Server.new
191
+ Dir.chdir(::Rails.application.root)
192
+ server.start
193
+ end
168
194
  end
169
195
 
170
196
  def test_environment
@@ -271,6 +297,15 @@ module Zeus
271
297
  rescue LoadError # Rails 3.0 doesn't require this block to be run, but 3.2+ does
272
298
  end
273
299
 
300
+ def run_rails_5_1_or_higher_command(command)
301
+ require 'rails/command'
302
+ ::Rails::Command.invoke(command, ARGV)
303
+ end
304
+
305
+ def rails_5_1_or_higher?
306
+ (::Rails::VERSION::MAJOR == 5 && ::Rails::VERSION::MINOR >= 1) ||
307
+ ::Rails::VERSION::MAJOR > 5
308
+ end
274
309
  end
275
310
  end
276
311
 
data/lib/zeus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zeus
2
- VERSION = "0.15.14"
2
+ VERSION = "0.16.0"
3
3
  end
data/lib/zeus.rb CHANGED
@@ -13,7 +13,6 @@ require 'set'
13
13
  require 'zeus/load_tracking'
14
14
  require 'zeus/plan'
15
15
  require 'zeus/version'
16
- require 'zeus/pry'
17
16
 
18
17
  module Zeus
19
18
  class << self
data/man/build/zeus CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "ZEUS" "1" "January 2017" "" ""
4
+ .TH "ZEUS" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBzeus\fR \- boot rails in under a second
data/man/build/zeus-init CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "ZEUS\-INIT" "1" "January 2017" "" ""
4
+ .TH "ZEUS\-INIT" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBzeus\-init\fR \- Generate a template zeus\.json
@@ -1,17 +1 @@
1
- ZEUS-INIT(1) ZEUS-INIT(1)
2
1
 
3
-
4
-
5
- NAME
6
- zeus-init - Generate a template zeus.json
7
-
8
- SYNOPSIS
9
- zeus init
10
-
11
- DESCRIPTION
12
- Creates a zeus.json file in the current directory. This example file is
13
- useful for rails applications, but can be modified to suit your needs.
14
-
15
-
16
-
17
- January 2017 ZEUS-INIT(1)
data/man/build/zeus-start CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "ZEUS\-START" "1" "January 2017" "" ""
4
+ .TH "ZEUS\-START" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBzeus\-start\fR \- Start a zeus server
@@ -1,18 +1 @@
1
- ZEUS-START(1) ZEUS-START(1)
2
1
 
3
-
4
-
5
- NAME
6
- zeus-start - Start a zeus server
7
-
8
- SYNOPSIS
9
- zeus start
10
-
11
- DESCRIPTION
12
- Start a server.
13
-
14
- TODO: Better docs.
15
-
16
-
17
-
18
- January 2017 ZEUS-START(1)
data/man/build/zeus.txt CHANGED
@@ -1,78 +1 @@
1
- ZEUS(1) ZEUS(1)
2
1
 
3
-
4
-
5
- NAME
6
- zeus - boot rails in under a second
7
-
8
- SYNOPSIS
9
- zeus [--no-color] [--log FILE] [--file-change-delay TIME] [--config
10
- PATH] COMMAND [ARGS]
11
-
12
- DESCRIPTION
13
- Zeus makes working with large codebases much less painful.
14
-
15
- To use Zeus with Ruby on Rails 3.0+, Just run zeus start in your
16
- project directory. It will output a list of available commands, includ-
17
- ing tasks to spawn consoles, servers, tests, and rake tasks.
18
-
19
- See https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
20
- for information on modifying the boot process that Zeus uses by default
21
- and adding custom tasks.
22
-
23
- SLIGHTLY MORE TECHNICAL DESCRIPTION
24
- Zeus is a language-agnostic application checkpointer for non-multi-
25
- threaded applications.
26
-
27
- It is primarily targeted at ruby and other dynamic languages, where
28
- application boot time can be tens of seconds, but it can be made to
29
- work for nearly any language. However, zeus does not work well with
30
- multithreaded applications. It relies heavily on fork(2), which is
31
- largely incompatible with multithreaded systems.
32
-
33
- Currently only ruby is targeted, but support for other languages is
34
- planned.
35
-
36
- Zeus lets you define common tasks, and preloads all of them in the
37
- background. When you ask to run them, zeus transparently connects your
38
- terminal to the already-running process in milliseconds.
39
-
40
- This lets you, for example, run unit tests in dozens of milliseconds,
41
- rather than dozens of seconds.
42
-
43
- Zeus also monitors all files loaded by your application, and restarts
44
- parts of it when dependencies change, to keep everything up-to-date.
45
-
46
- WAY MORE TECHNICAL DESCRIPTION
47
- See https://github.com/burke/zeus/blob/master/docs/overview.md
48
-
49
- OPTIONS
50
- --no-color
51
- Prints all output without color
52
-
53
- --log trace-log-name
54
- Prints process tree state details to the log file specified.
55
-
56
- --file-change-delay delay
57
- Collect all file changes that happen within the specified delay
58
- time and restart processes only after this deadline expires. The
59
- argument must be parseable by time.ParseDuration. The default
60
- delay is 300ms.
61
-
62
- --config path
63
- Read from the given JSON config file. Defaults to zeus.json.
64
-
65
- BUILTIN COMMANDS
66
- zeus start(1) zeus-start.1.html
67
- Start a zeus server in the current directory using zeus.json
68
-
69
- zeus init(1) zeus-init.1.html
70
- Generate a template zeus.json
71
-
72
- zeus commands(1)
73
- List the commands defined by zeus.json
74
-
75
-
76
-
77
-
78
- January 2017 ZEUS(1)
@@ -69,11 +69,7 @@ describe "Zeus::LoadTracking" do
69
69
 
70
70
  context 'loading invalid code' do
71
71
  it 'tracks requires that raise a SyntaxError' do
72
- files = [expand_asset_path('invalid_syntax.rb')]
73
- # SyntaxError does not have a backtrace in 2.3+ (https://bugs.ruby-lang.org/issues/12811)
74
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
75
- files << test_filename
76
- end
72
+ files = [test_filename, expand_asset_path('invalid_syntax.rb')]
77
73
 
78
74
  expect_to_load(files, SyntaxError) do
79
75
  require expand_asset_path('invalid_syntax')
data/spec/zeus_spec.rb CHANGED
@@ -40,7 +40,7 @@ describe Zeus do
40
40
  begin
41
41
  Zeus.go
42
42
  rescue Interrupt
43
- return
43
+ next
44
44
  rescue => e
45
45
  STDERR.puts "Zeus terminated with exception: #{e.message}"
46
46
  STDERR.puts e.backtrace.map {|line| " #{line}"}
data/zeus.gemspec CHANGED
@@ -29,5 +29,5 @@ Gem::Specification.new do |gem|
29
29
 
30
30
  gem.add_runtime_dependency "method_source", ">= 0.6.7"
31
31
 
32
- gem.add_development_dependency "bundler", '~> 1.6'
32
+ gem.add_development_dependency "bundler", '~> 2.3'
33
33
  end
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.15.14
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '2.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '2.3'
41
41
  description: Boot any rails app in under a second
42
42
  email:
43
43
  - burke@libbey.me
@@ -46,7 +46,6 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - ".bundle/config"
50
49
  - Gemfile
51
50
  - Gemfile.lock
52
51
  - MIT-LICENSE
@@ -56,6 +55,7 @@ files:
56
55
  - bin/rspec
57
56
  - bin/zeus
58
57
  - build/zeus-darwin-amd64
58
+ - build/zeus-darwin-arm64
59
59
  - build/zeus-linux-386
60
60
  - build/zeus-linux-amd64
61
61
  - examples/custom_plan/cucumber_plan.rb
@@ -96,7 +96,7 @@ homepage: https://github.com/burke/zeus
96
96
  licenses:
97
97
  - MIT
98
98
  metadata: {}
99
- post_install_message:
99
+ post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
@@ -111,9 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.4.8
116
- signing_key:
114
+ rubygems_version: 3.1.6
115
+ signing_key:
117
116
  specification_version: 4
118
117
  summary: Zeus is an intelligent preloader for ruby applications. It allows normal
119
118
  development tasks to be run in a fraction of a second.
data/.bundle/config DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_DISABLE_SHARED_GEMS: "true"