Sha256: 7e1716c48989b5a23e63177175cb12078de128269b0b430aa958d4f5f3b6e675

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

module LitmusPaper
  class Configuration
    def initialize(config_file_path)
      @config_file_path = config_file_path
      @services = {}
    end

    def evaluate(file = @config_file_path)
      config_contents = File.read(file)
      instance_eval(config_contents)
      @services
    end

    def include_files(glob_pattern)
      full_glob_pattern = File.expand_path(glob_pattern, File.dirname(@config_file_path))
      Dir.glob(full_glob_pattern).each do |file|
        evaluate(file)
      end
    end

    def service(name, &block)
      service = Service.new(name.to_s)
      block.call(service)
      @services[name.to_s] = service
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
litmus_paper-0.0.3 lib/litmus_paper/configuration.rb