From 1c272bf41f64b9ec5fea80579c46bb51dab2e141 Mon Sep 17 00:00:00 2001 From: Kevin Mullin Date: Fri, 5 Oct 2012 12:52:35 -0700 Subject: [PATCH] a better way to do config.ru, doesn't require ruby 1.9.3 --- config.ru | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/config.ru b/config.ru index 261d1e71c..d29422417 100644 --- a/config.ru +++ b/config.ru @@ -1,9 +1,17 @@ -require './kibana' -require 'rubygems' -require 'sinatra' +root_dir = File.dirname(__FILE__) +app_file = File.join(root_dir, 'kibana.rb') + +require app_file + +begin + require 'sinatra' +rescue LoadError + require 'rubygems' + require 'sinatra' +end set :environment, ENV['RACK_ENV'].to_sym -set :app_file, 'kibana.rb' +set :app_file, app_file disable :run run Sinatra::Application