zeus 0.3.0 → 0.3.1

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.
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 **ONE second**.
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:
@@ -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
 
@@ -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
@@ -40,7 +40,7 @@ module Zeus
40
40
 
41
41
  def register_acceptors_as_errors(e)
42
42
  descendent_acceptors.each do |acc|
43
- acc = acc.extend(AcceptorErrorState)
43
+ acc = acc.extend(Acceptor::ErrorState)
44
44
  acc.error = e
45
45
  acc.run
46
46
  end
@@ -1,3 +1,3 @@
1
1
  module Zeus
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -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{Zeus preloads pretty much everything you'll ever want to use in development.}
8
- gem.summary = %q{Zeus is an alpha-quality application preloader with terrible documentation.}
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.0
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: Zeus preloads pretty much everything you'll ever want to use in development.
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 alpha-quality application preloader with terrible documentation.
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
-