Sha256: 779a4aa34ab1bb89e3d00e04a5d587a1de51457394227cadf8804de6059fb621

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'yaml'

module Coco

  # I know the configuration of coco.
  #
  # @example read the threeshold value
  #   config = Configuration.new
  #   config[:threeshold]
  #   => 90
  #
  # You can override the default configuration by putting a '.coco' file 
  # in YAML format in the project root directory.
  # @example to override the threeshold put this line in a '.coco' file:
  #   :threeshold: 70
  #
  # @note You can set the threeshold above 100% (to be sure to see all files) but you
  #   cannot set it under 0.
  class Configuration < Hash
  
    def initialize
      self[:threeshold] = 90
      self[:directories] = ['lib']
      self[:excludes] = []
      if File.exist?('.coco')
        conf = YAML.load_file '.coco'
        self.merge!(conf)
      end
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coco-0.5 lib/coco/configuration.rb
coco-0.4.2 lib/coco/configuration.rb
coco-0.4.1 lib/coco/configuration.rb