Module: Culerity
- Defined in:
- lib/culerity.rb,
lib/culerity/celerity_server.rb,
lib/culerity/persistent_delivery.rb,
lib/culerity/remote_object_proxy.rb,
lib/culerity/remote_browser_proxy.rb
Defined Under Namespace
Modules: PersistentDelivery, ServerCommands
Classes: CelerityServer, CulerityException, RemoteBrowserProxy, RemoteObjectProxy
Class Method Summary
collapse
Class Method Details
.celerity_invocation ⇒ Object
31
32
33
|
# File 'lib/culerity.rb', line 31
def self.celerity_invocation
%{#{culerity_root}/lib/start_celerity.rb}
end
|
.culerity_root ⇒ Object
27
28
29
|
# File 'lib/culerity.rb', line 27
def self.culerity_root
File.expand_path('../../', __FILE__)
end
|
.jruby_invocation ⇒ Object
35
36
37
|
# File 'lib/culerity.rb', line 35
def self.jruby_invocation
@jruby_invocation ||= (ENV["JRUBY_INVOCATION"] || "jruby")
end
|
.jruby_invocation=(invocation) ⇒ Object
39
40
41
|
# File 'lib/culerity.rb', line 39
def self.jruby_invocation=(invocation)
@jruby_invocation = invocation
end
|
.run_rails(options = {}) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/culerity.rb', line 47
def self.run_rails(options = {})
if defined?(Rails) && !File.exists?("tmp/culerity_rails_server.pid")
puts "WARNING: Speed up execution by running 'rake culerity:rails:start'"
port = options[:port] || 3001
environment = options[:environment] || 'culerity'
rails_server = fork do
$stdin.reopen "/dev/null"
$stdout.reopen "/dev/null"
$stderr.reopen "/dev/null"
Dir.chdir(Rails.root) do
exec "script/server -e #{environment} -p #{port}"
end
end
sleep 5
rails_server
end
end
|
.run_server ⇒ Object
43
44
45
|
# File 'lib/culerity.rb', line 43
def self.run_server
IO.popen(%{RUBYOPT="" #{jruby_invocation} "#{celerity_invocation}"}, 'r+').extend(ServerCommands)
end
|