Top Level Namespace
Defined Under Namespace
Modules: GlassFish, JRuby, Merb, Rack, Rails
Instance Method Summary collapse
Instance Method Details
#get_rackup_app(config, env = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/jruby/rack/rackup.rb', line 16 def get_rackup_app(config, env={}) config ||= "config.ru" #Load all the files inside this directory $: << "#{File.dirname(config)}" #Read contents of rackup script config_data = File.read(config) #create an app based on whats given by the rackup script inner_app = eval "Rack::Builder.new {( " + config_data + "\n )}.to_app",nil, config case env when "development", "test" app = Rack::Builder.new { use Rack::CommonLogger, $stderr use Rack::ShowExceptions use Rack::Lint run inner_app }.to_app when "deployment", "production" app = Rack::Builder.new { use Rack::CommonLogger, $stderr run inner_app }.to_app when "none" app = inner_app end end |