zeus 0.10.0.pre → 0.10.0.pre2
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/build/zeus-darwin-amd64 +0 -0
- data/build/zeus-linux-386 +0 -0
- data/build/zeus-linux-amd64 +0 -0
- data/lib/zeus.rb +3 -0
- data/lib/zeus/plan.rb +0 -0
- data/lib/zeus/rails.rb +99 -102
- metadata +3 -2
data/build/zeus-darwin-amd64
CHANGED
Binary file
|
data/build/zeus-linux-386
CHANGED
Binary file
|
data/build/zeus-linux-amd64
CHANGED
Binary file
|
data/lib/zeus.rb
CHANGED
data/lib/zeus/plan.rb
ADDED
File without changes
|
data/lib/zeus/rails.rb
CHANGED
@@ -5,137 +5,134 @@ APP_PATH = File.expand_path('config/application', ROOT_PATH)
|
|
5
5
|
|
6
6
|
require 'zeus'
|
7
7
|
|
8
|
-
module Zeus ; module Rails ; end ; end
|
9
|
-
Zeus.plan ||= Zeus::Rails
|
10
|
-
|
11
8
|
module Zeus
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
restart_girl_friday
|
18
|
-
end
|
19
|
-
|
20
|
-
def boot
|
21
|
-
require BOOT_PATH
|
22
|
-
require 'rails/all'
|
23
|
-
end
|
9
|
+
class Rails < Plan
|
10
|
+
def after_fork
|
11
|
+
reconnect_activerecord
|
12
|
+
restart_girl_friday
|
13
|
+
end
|
24
14
|
|
25
|
-
|
26
|
-
|
27
|
-
|
15
|
+
def boot
|
16
|
+
require BOOT_PATH
|
17
|
+
require 'rails/all'
|
18
|
+
end
|
28
19
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
require APP_PATH
|
33
|
-
::Rails.application.require_environment!
|
34
|
-
end
|
20
|
+
def default_bundle
|
21
|
+
Bundler.require(:default)
|
22
|
+
end
|
35
23
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
24
|
+
def development_environment
|
25
|
+
Bundler.require(:development)
|
26
|
+
::Rails.env = ENV['RAILS_ENV'] = "development"
|
27
|
+
require APP_PATH
|
28
|
+
::Rails.application.require_environment!
|
29
|
+
end
|
40
30
|
|
41
|
-
|
42
|
-
|
43
|
-
|
31
|
+
def prerake
|
32
|
+
require 'rake'
|
33
|
+
load 'Rakefile'
|
34
|
+
end
|
44
35
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
::Rails.application.load_generators
|
49
|
-
rescue LoadError # Rails 3.0 doesn't require this block to be run, but 3.2+ does
|
50
|
-
end
|
51
|
-
require 'rails/commands/generate'
|
52
|
-
end
|
36
|
+
def rake
|
37
|
+
Rake.application.run
|
38
|
+
end
|
53
39
|
|
54
|
-
|
55
|
-
|
40
|
+
def generate
|
41
|
+
begin
|
42
|
+
require 'rails/generators'
|
43
|
+
::Rails.application.load_generators
|
44
|
+
rescue LoadError # Rails 3.0 doesn't require this block to be run, but 3.2+ does
|
56
45
|
end
|
46
|
+
require 'rails/commands/generate'
|
47
|
+
end
|
57
48
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
49
|
+
def runner
|
50
|
+
require 'rails/commands/runner'
|
51
|
+
end
|
62
52
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
server.start
|
68
|
-
end
|
53
|
+
def console
|
54
|
+
require 'rails/commands/console'
|
55
|
+
::Rails::Console.start(::Rails.application)
|
56
|
+
end
|
69
57
|
|
70
|
-
|
71
|
-
|
58
|
+
def server
|
59
|
+
require 'rails/commands/server'
|
60
|
+
server = ::Rails::Server.new
|
61
|
+
Dir.chdir(::Rails.application.root)
|
62
|
+
server.start
|
63
|
+
end
|
72
64
|
|
73
|
-
|
74
|
-
|
65
|
+
def test_environment
|
66
|
+
Bundler.require(:test)
|
75
67
|
|
76
|
-
|
77
|
-
|
78
|
-
$rails_rake_task = nil
|
79
|
-
$LOAD_PATH.unshift(ROOT_PATH) unless $LOAD_PATH.include?(ROOT_PATH)
|
68
|
+
::Rails.env = ENV['RAILS_ENV'] = 'test'
|
69
|
+
require APP_PATH
|
80
70
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
71
|
+
$rails_rake_task = 'yup' # lie to skip eager loading
|
72
|
+
::Rails.application.require_environment!
|
73
|
+
$rails_rake_task = nil
|
74
|
+
$LOAD_PATH.unshift(ROOT_PATH) unless $LOAD_PATH.include?(ROOT_PATH)
|
85
75
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
76
|
+
if Dir.exist?(ROOT_PATH + "/test")
|
77
|
+
test = File.join(ROOT_PATH, 'test')
|
78
|
+
$LOAD_PATH.unshift(test) unless $LOAD_PATH.include?(test)
|
90
79
|
end
|
91
80
|
|
92
|
-
|
93
|
-
|
81
|
+
if Dir.exist?(ROOT_PATH + "/spec")
|
82
|
+
spec = File.join(ROOT_PATH, 'spec')
|
83
|
+
$LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
|
94
84
|
end
|
85
|
+
end
|
95
86
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
# try to find pattern by line using testrbl
|
100
|
-
if defined?(Testrbl) && argv.size == 1 and argv.first =~ /^\S+:\d+$/
|
101
|
-
file, line = argv.first.split(':')
|
102
|
-
argv = [file, '-n', "/#{Testrbl.send(:pattern_from_file, File.readlines(file), line)}/"]
|
103
|
-
puts "using -n '#{argv[2]}'" # let users copy/paste or adjust the pattern
|
104
|
-
end
|
105
|
-
|
106
|
-
runner = Test::Unit::AutoRunner.new(true)
|
107
|
-
if runner.process_args(argv)
|
108
|
-
exit runner.run
|
109
|
-
else
|
110
|
-
abort runner.options.banner + " tests..."
|
111
|
-
end
|
112
|
-
end
|
87
|
+
def test_helper
|
88
|
+
require 'test_helper'
|
89
|
+
end
|
113
90
|
|
114
|
-
|
115
|
-
|
91
|
+
def testrb
|
92
|
+
argv = ARGV
|
93
|
+
|
94
|
+
# try to find pattern by line using testrbl
|
95
|
+
if defined?(Testrbl) && argv.size == 1 and argv.first =~ /^\S+:\d+$/
|
96
|
+
file, line = argv.first.split(':')
|
97
|
+
argv = [file, '-n', "/#{Testrbl.send(:pattern_from_file, File.readlines(file), line)}/"]
|
98
|
+
puts "using -n '#{argv[2]}'" # let users copy/paste or adjust the pattern
|
116
99
|
end
|
117
100
|
|
118
|
-
|
119
|
-
|
101
|
+
runner = Test::Unit::AutoRunner.new(true)
|
102
|
+
if runner.process_args(argv)
|
103
|
+
exit runner.run
|
104
|
+
else
|
105
|
+
abort runner.options.banner + " tests..."
|
120
106
|
end
|
107
|
+
end
|
121
108
|
|
109
|
+
def spec_helper
|
110
|
+
require 'spec_helper'
|
111
|
+
end
|
112
|
+
|
113
|
+
def rspec
|
114
|
+
exit RSpec::Core::Runner.run(ARGV)
|
115
|
+
end
|
122
116
|
|
123
|
-
private
|
124
117
|
|
125
|
-
|
126
|
-
return unless defined?(GirlFriday::WorkQueue)
|
127
|
-
# The Actor is run in a thread, and threads don't persist post-fork.
|
128
|
-
# We just need to restart each one in the newly-forked process.
|
129
|
-
ObjectSpace.each_object(GirlFriday::WorkQueue) do |obj|
|
130
|
-
obj.send(:start)
|
131
|
-
end
|
132
|
-
end
|
118
|
+
private
|
133
119
|
|
134
|
-
|
135
|
-
|
136
|
-
|
120
|
+
def restart_girl_friday
|
121
|
+
return unless defined?(GirlFriday::WorkQueue)
|
122
|
+
# The Actor is run in a thread, and threads don't persist post-fork.
|
123
|
+
# We just need to restart each one in the newly-forked process.
|
124
|
+
ObjectSpace.each_object(GirlFriday::WorkQueue) do |obj|
|
125
|
+
obj.send(:start)
|
137
126
|
end
|
127
|
+
end
|
138
128
|
|
129
|
+
def reconnect_activerecord
|
130
|
+
ActiveRecord::Base.clear_all_connections! rescue nil
|
131
|
+
ActiveRecord::Base.establish_connection rescue nil
|
139
132
|
end
|
133
|
+
|
140
134
|
end
|
141
135
|
end
|
136
|
+
|
137
|
+
Zeus.plan ||= Zeus::Rails.new
|
138
|
+
|
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.10.0.
|
4
|
+
version: 0.10.0.pre2
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Boot any rails app in under a second
|
15
15
|
email:
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- ext/inotify-wrapper/inotify-wrapper.cpp
|
32
32
|
- Gemfile
|
33
33
|
- lib/zeus/load_tracking.rb
|
34
|
+
- lib/zeus/plan.rb
|
34
35
|
- lib/zeus/rails.rb
|
35
36
|
- lib/zeus.rb
|
36
37
|
- man/build/zeus
|