Skip to content

Commit

Permalink
Separated starling config to defaults.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Jul 25, 2010
1 parent 79b526d commit 3d0b332
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions script/starling.rb
Expand Up @@ -4,14 +4,20 @@

path = File.dirname(__FILE__)

config = YAML.load_file(path + "/../config/workling.yml")
config = YAML.load_file(path + "/../config/defaults.yml")

env = ENV['RAILS_ENV'] || 'production'

config = config[env]
if !config['starling']
if env == 'production'
config['starling'] = 'localhost:15151'
else
config['starling'] = 'localhost:22122'
end
end

host = config['listens_on'].split(":")[0]
port = config['listens_on'].split(":")[1]
host = config['starling'].split(":")[0]
port = config['starling'].split(":")[1]

cmd = "starling -d -P #{path}/../tmp/pids/starling.pid -q #{path}/../tmp/starling_#{env}/ -h #{host} -p #{port}"
puts("Running #{env}:" + cmd)
Expand Down

0 comments on commit 3d0b332

Please sign in to comment.