Sha256: e57733ce7e43f5dbb105311db760a51da49a12c66a1b4004a90176b799efeb5b
Contents?: true
Size: 1.07 KB
Versions: 3
Compression:
Stored size: 1.07 KB
Contents
require 'logger' require 'yaml' module CLIUtils # Configuration Module # Manages any configuration values and the flat YAML file # into which they get stored. module Configuration # Allows easy access to Logger levels. LOG_LEVELS = { 'DEBUG' => Logger::DEBUG, 'INFO' => Logger::INFO, 'WARN' => Logger::WARN, 'ERROR' => Logger::ERROR, 'FATAL' => Logger::FATAL, } # Hook that triggers when this module is included. # @param [Object] k The includer object # @return [void] def self.included(k) k.extend(self) end # Singleton method to return (or initialize, if needed) # a Configurator. # @return [Configurator] def configuration @@configuration ||= Configurator.new('~/.default-cliutils') end # Singleton method to return (or initialize, if needed) # a Configurator. # @param [String] path The filepath to use # @return [void] def load_configuration(path) @@configuration = Configurator.new(path) end alias configuration= load_configuration end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cliutils-1.2.1 | lib/cliutils/configuration.rb |
cliutils-1.2.0 | lib/cliutils/configuration.rb |
cliutils-1.1.1 | lib/cliutils/configuration.rb |