Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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