Skip to content

Instantly share code, notes, and snippets.

@koraktor
Created January 24, 2011 18:42
Show Gist options
  • Save koraktor/793690 to your computer and use it in GitHub Desktop.
Save koraktor/793690 to your computer and use it in GitHub Desktop.
Rubikon: A global option to override config files
class ConfigSample < Rubikon::Application::Base
global_option :c => :config
global_option :config, 'Override the configuration with the given file', :config_file do
path = File.dirname config_file
file = File.basename config_file
config = Rubikon::Config::Factory.new(file, path).config
@__app__.instance_eval { @config = config }
end
default do
p config
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment