zeus 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -1
- data/lib/zeus/server.rb +0 -1
- data/lib/zeus/server/acceptor.rb +26 -0
- data/lib/zeus/server/stage.rb +1 -1
- data/lib/zeus/version.rb +1 -1
- data/zeus.gemspec +2 -2
- metadata +4 -4
- data/lib/zeus/server/acceptor_error_state.rb +0 -35
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## What is Zeus?
|
4
4
|
|
5
|
-
Zeus preloads your app so that your normal development tasks such as `console`, `server`, `generate`, and tests take **
|
5
|
+
Zeus preloads your app so that your normal development tasks such as `console`, `server`, `generate`, and tests take **less than one second**.
|
6
6
|
|
7
7
|
This screencast gives a quick overview of how to use zeus:
|
8
8
|
|
@@ -25,6 +25,10 @@ Install the gem.
|
|
25
25
|
|
26
26
|
gem install zeus
|
27
27
|
|
28
|
+
Q: "I should put it in my `Gemfile`, right?"
|
29
|
+
|
30
|
+
A: No. running `bundle exec zeus` instead of `zeus` can add precious seconds to a command that otherwise would take 200ms. Zeus was built to be run from outside of bundler.
|
31
|
+
|
28
32
|
## Usage
|
29
33
|
|
30
34
|
Start the server:
|
data/lib/zeus/server.rb
CHANGED
@@ -12,7 +12,6 @@ module Zeus
|
|
12
12
|
autoload :ProcessTree, 'zeus/server/process_tree'
|
13
13
|
autoload :ForkedProcess, 'zeus/server/forked_process'
|
14
14
|
autoload :ClientHandler, 'zeus/server/client_handler'
|
15
|
-
autoload :AcceptorErrorState, 'zeus/server/acceptor_error_state'
|
16
15
|
autoload :ProcessTreeMonitor, 'zeus/server/process_tree_monitor'
|
17
16
|
autoload :AcceptorRegistrationMonitor, 'zeus/server/acceptor_registration_monitor'
|
18
17
|
|
data/lib/zeus/server/acceptor.rb
CHANGED
@@ -81,6 +81,32 @@ module Zeus
|
|
81
81
|
# ActiveSupport::Dependencies.clear rescue nil
|
82
82
|
end
|
83
83
|
|
84
|
+
module ErrorState
|
85
|
+
attr_accessor :error
|
86
|
+
|
87
|
+
def print_error(io, error = @error)
|
88
|
+
io.puts "#{error.backtrace[0]}: #{error.message} (#{error.class})"
|
89
|
+
error.backtrace[1..-1].each do |line|
|
90
|
+
io.puts "\tfrom #{line}"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def run
|
95
|
+
register_with_client_handler(Process.pid)
|
96
|
+
Zeus.ui.info "starting error-state acceptor `#{@name}`"
|
97
|
+
|
98
|
+
Thread.new do
|
99
|
+
loop do
|
100
|
+
terminal = @s_acceptor.recv_io
|
101
|
+
_ = @s_acceptor.readline
|
102
|
+
@s_acceptor << 0 << "\n"
|
103
|
+
print_error(terminal)
|
104
|
+
terminal.close
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
84
110
|
end
|
85
111
|
end
|
86
112
|
end
|
data/lib/zeus/server/stage.rb
CHANGED
data/lib/zeus/version.rb
CHANGED
data/zeus.gemspec
CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/zeus/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Burke Libbey"]
|
6
6
|
gem.email = ["burke@libbey.me"]
|
7
|
-
gem.description = %q{
|
8
|
-
gem.summary = %q{Zeus is an
|
7
|
+
gem.description = %q{Boot any rails app in under a second}
|
8
|
+
gem.summary = %q{Zeus is an intelligent preloader for ruby applications. It allows normal development tasks to be run in a fraction of a second.}
|
9
9
|
gem.homepage = "http://github.com/burke/zeus"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split("\n").reject{ |f| f =~ /xcodeproj/ }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: Boot any rails app in under a second
|
15
15
|
email:
|
16
16
|
- burke@libbey.me
|
17
17
|
executables:
|
@@ -35,7 +35,6 @@ files:
|
|
35
35
|
- lib/zeus/dsl.rb
|
36
36
|
- lib/zeus/server.rb
|
37
37
|
- lib/zeus/server/acceptor.rb
|
38
|
-
- lib/zeus/server/acceptor_error_state.rb
|
39
38
|
- lib/zeus/server/acceptor_registration_monitor.rb
|
40
39
|
- lib/zeus/server/client_handler.rb
|
41
40
|
- lib/zeus/server/file_monitor.rb
|
@@ -76,7 +75,8 @@ rubyforge_project:
|
|
76
75
|
rubygems_version: 1.8.11
|
77
76
|
signing_key:
|
78
77
|
specification_version: 3
|
79
|
-
summary: Zeus is an
|
78
|
+
summary: Zeus is an intelligent preloader for ruby applications. It allows normal
|
79
|
+
development tasks to be run in a fraction of a second.
|
80
80
|
test_files:
|
81
81
|
- spec/cli_spec.rb
|
82
82
|
- spec/server/file_monitor/fsevent_spec.rb
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'socket'
|
3
|
-
|
4
|
-
# See Zeus::Server::ClientHandler for relevant documentation
|
5
|
-
module Zeus
|
6
|
-
class Server
|
7
|
-
module AcceptorErrorState
|
8
|
-
attr_accessor :error
|
9
|
-
|
10
|
-
def print_error(io, error = @error)
|
11
|
-
io.puts "#{error.backtrace[0]}: #{error.message} (#{error.class})"
|
12
|
-
error.backtrace[1..-1].each do |line|
|
13
|
-
io.puts "\tfrom #{line}"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
register_with_client_handler(Process.pid)
|
19
|
-
Zeus.ui.info "starting error-state acceptor `#{@name}`"
|
20
|
-
|
21
|
-
Thread.new do
|
22
|
-
loop do
|
23
|
-
terminal = @s_acceptor.recv_io
|
24
|
-
_ = @s_acceptor.readline
|
25
|
-
@s_acceptor << 0 << "\n"
|
26
|
-
print_error(terminal)
|
27
|
-
terminal.close
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|