12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'merb-core/lib/merb-core/rack/adapter/runner.rb', line 12
def self.start(opts={})
Merb::Server.change_privilege
if opts[:runner_code]
runner_code = opts[:runner_code]
if File.exists?(opts[:runner_code])
runner_code = File.read(runner_code)
runner_script = true
end
begin
eval(runner_code, TOPLEVEL_BINDING, __FILE__, __LINE__)
rescue Exception => e
if !runner_script && (runner_code.include?(File::SEPARATOR) || runner_code.include?(".rb"))
Merb.logger.error!("Merb Runner Adapter - tried to execute script file")
Merb.logger.error!("Not Found: #{runner_code}")
else
raise e
end
end
exit
end
end
|