Skip to content

Commit

Permalink
1) CLI options are parsed now before loading of RoR environment
Browse files Browse the repository at this point in the history
    so the --environment is known before loading
2) changed loading of config/boot to config/environment
  • Loading branch information
Alex P committed Mar 3, 2008
1 parent 918bf33 commit 78b956b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions script/backgroundrb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ WORKER_ROOT = rails_root + "/lib/workers"
["server","server/lib","lib","lib/backgroundrb"].each { |x| $LOAD_PATH.unshift(PACKET_APP + "/#{x}")}
$LOAD_PATH.unshift(WORKER_ROOT)

require RAILS_HOME + '/config/boot.rb'
require "rubygems"
# parse CLI options and set RAILS_ENV before loading RoR environment
require "bdrb_config.rb"
BackgrounDRb::Config.parse_cmd_options

require RAILS_HOME + '/config/environment'
#require RAILS_HOME + '/config/boot.rb'
require "rubygems"
require "yaml"
require "erb"
require "logger"
require "packet"
require "backgroundrb_server"
require "bdrb_config.rb"

BackgrounDRb::Config.parse_cmd_options
CONFIG_FILE = BackgrounDRb::Config.read_config("#{RAILS_HOME}/config/backgroundrb.yml")
pid_file = "#{RAILS_HOME}/tmp/pids/backgroundrb_#{CONFIG_FILE[:backgroundrb][:port]}.pid"
SERVER_LOGGER = "#{RAILS_HOME}/log/backgroundrb_server_#{CONFIG_FILE[:backgroundrb][:port]}.log"
Expand Down

0 comments on commit 78b956b

Please sign in to comment.