Skip to content

Instantly share code, notes, and snippets.

@klochner
Created July 30, 2009 00:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klochner/158487 to your computer and use it in GitHub Desktop.
Save klochner/158487 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'optparse'
require 'yaml'
options = {}
ARGV.options do |opts|
opts.on( "-c", "--configfile ENVIRONMENT", String,
"mongrel cluster config file." ) do |config_file|
options[:config_file] = config_file
end
opts.parse!
end
RAILS_ENV = if options[:config_file]
File.open(options[:config_file]) {|f| YAML.load(f)["environment"]}
else "production"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment