Sha256: 3ef50a84c4ffad454c8fb17611f808e87b1d5b44947dabde8a11bcac4315fb89
Contents?: true
Size: 496 Bytes
Versions: 4
Compression:
Stored size: 496 Bytes
Contents
module Dotenv # This class inherits from Hash and represents the environemnt into which # Dotenv will load key value pairs from a file. class Environment < Hash attr_reader :filename def initialize(filename) @filename = filename load end def load update Parser.call(read) end def read File.read(@filename) end def apply each { |k, v| ENV[k] ||= v } end def apply! each { |k, v| ENV[k] = v } end end end
Version data entries
4 entries across 4 versions & 2 rubygems