Sha256: 2047668bd469f7da210c496030fea694a0c71bc700d8cdd364ef01eb3b29265b

Contents?: true

Size: 1.35 KB

Versions: 5

Compression:

Stored size: 1.35 KB

Contents

require 'date'                      # type conversion
require 'time'                      # type conversion
require 'yaml'                      # read files
require 'fileutils'                 # so save! can mkdir
require 'configliere/deep_hash'     # magic hash for params
require 'configliere/param'         # params container
require 'configliere/define'        # define param behavior
require 'configliere/config_file'   # read / save! files

# use(:encrypted) will bring in 'digest/sha2' and 'openssl'
# use(:prompt)    will bring in 'highline', which you must gem install
# running the specs requires rspec and spork

module Configliere
  ALL_MIXINS = [:define, :config_file, :commandline, :encrypted, :env_var, :config_block, :commands, :prompt]
  def self.use *mixins
    mixins = ALL_MIXINS if mixins.include?(:all) || mixins.empty?
    mixins.each do |mixin|
      require "configliere/#{mixin}"
    end
  end

end

# Base class for Configliere errors.
class Configliere::Error           < StandardError      ; end
# Feature is deprecated, has or will leave the building
class Configliere::DeprecatedError < Configliere::Error ; end

# Defines a global config object
Settings = Configliere::Param.new unless defined?(Settings)

#
# Also define Settings as a function, so you can say
#   Settings :this => that, :cat => :hat
#
def Settings *args
  Settings.defaults(*args)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
configliere-0.4.8 lib/configliere.rb
configliere-0.4.7 lib/configliere.rb
configliere-0.4.6 lib/configliere.rb
configliere-0.4.5 lib/configliere.rb
configliere-0.4.4 lib/configliere.rb