Sha256: 339f08ef7d24b770510fbaaa36b8556b3098c24d6daee917478a113d9cb55f97
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
module Kthxbye # This module handles the setting and retrival of configuration options for # Kthxbye. module Config # Default options for Kthxbye # # * redis_server = "127.0.0.1" - the ip to connect to by defaut # * redis_port = 9876 - default redis port # * attempts = 1 -default number of attempts on a failing job before a Failure # is generated # * vervose = false - more output in the worker log DEFAULT = {:redis_server => '127.0.0.1', :redis_port => 9876, :attempts => 1, :verbose => false}.freeze # This method takes override args input by the user. # Can pull from a config/kthxbye.yaml file as well. # # NEEDS TO BE REWORKED FOR RAILS APPS def self.setup( args=nil ) @options ||= DEFAULT.dup @options.merge!( YAML.load('./config/kthxbye.yaml') ) if File.exist?( './config/kthxbye.yaml' ) @options.merge!( args ) if args end # Quick access to the options hash. Works for setting individual options # during runtime. def self.options return @options if @options Config.setup end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
kthxbye-1.3.2 | lib/kthxbye/config.rb |
kthxbye-1.3.0 | lib/kthxbye/config.rb |
kthxbye-1.2.1 | lib/kthxbye/config.rb |
kthxbye-1.2.0 | lib/kthxbye/config.rb |