Sha256: 89ed6e863e50090125b2000eae8a94614ef0f12db62cb11bfdfba417bd62d6a6

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

require 'yaml'

module CLIUtils
  # Configuration Module
  # Manages any configuration values and the flat YAML file
  # into which they get stored.
  module Configuration
    # 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cliutils-1.0.4 lib/cliutils/configuration.rb
cliutils-1.0.3 lib/cliutils/configuration.rb