Sha256: d93c7940b762cd3e83128ec29af348044197438c2124dd58e903348e885aacb8

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 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
        Linner.root.join(@env["paths"][method]).expand_path.to_path
      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

1 entries across 1 versions & 1 rubygems

Version Path
linner-0.1.1 lib/linner/environment.rb