Created
January 24, 2011 18:42
-
-
Save koraktor/793690 to your computer and use it in GitHub Desktop.
Rubikon: A global option to override config files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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