Parent

Methods

Class Index [+]

Quicksearch

Merb::Rack::Runner

Public Class Methods

start(opts={}) click to toggle source

Parameters

opts

Options for the runner (see below).

Options (opts)

:runner_code

The code to run.

Notes

If opts[:runner_code] matches a filename, that file will be read and the contents executed. Otherwise the code will be executed directly.

:api: plugin

    # File lib/merb-core/rack/adapter/runner.rb, line 17
17:       def self.start(opts={})
18:         Merb::Server.change_privilege
19: 
20:         if opts[:runner_code]
21:           runner_code = opts[:runner_code]
22:           if File.exists?(opts[:runner_code])
23:             runner_code = File.read(runner_code)
24:             runner_script = true
25:           end
26: 
27:           begin
28:             eval(runner_code, TOPLEVEL_BINDING, __FILE__, __LINE__)
29:           rescue Exception => e
30:             # check to see if user gave us a string that links like they tried to run a script file
31:             if !runner_script && (runner_code.include?(File::SEPARATOR) || runner_code.include?(".rb"))
32:               Merb.logger.error!("Merb Runner Adapter - tried to execute script file")
33:               Merb.logger.error!("Not Found: #{runner_code}")
34:             else
35:               raise e
36:             end
37:           end
38:           exit
39:         end  
40:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.