Sha256: 7ec0daff1efb6fe8ab24f37b75dc5449fc04b781da709f2b34fbb3a835d5cc06

Contents?: true

Size: 609 Bytes

Versions: 4

Compression:

Stored size: 609 Bytes

Contents

require "yaml"

module Linner
  class Environment

    def initialize(path)
      @env ||= (YAML::load(File.read path) || Hash.new)
      @convension = YAML::load File.read(File.join File.dirname(__FILE__), "../../vendor", "config.default.yml")
      @env = @convension.rmerge!(@env)
    end

    %w(app test vendor public).each do |method|
      define_method("#{method}_folder") do
        @env["paths"][method]
      end
    end

    %w(notification wrapper).each do |method|
      define_method(method) do
        @env[method]
      end
    end

    def files
      @env["files"].values
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
linner-0.1.5 lib/linner/environment.rb
linner-0.1.4 lib/linner/environment.rb
linner-0.1.3 lib/linner/environment.rb
linner-0.1.2 lib/linner/environment.rb