Sha256: 0c66c9daa471166686adc7d1fc199b9537a62bb65bf3ee173601712e361980af
Contents?: true
Size: 522 Bytes
Versions: 40
Compression:
Stored size: 522 Bytes
Contents
require "foreman" class Foreman::Env attr_reader :entries def initialize(filename) @entries = File.read(filename).split("\n").inject({}) do |ax, line| if line =~ /\A([A-Za-z_0-9]+)=(.*)\z/ key = $1 case val = $2 when /\A'(.*)'\z/ then ax[key] = $1 when /\A"(.*)"\z/ then ax[key] = $1.gsub(/\\(.)/, '\1') else ax[key] = val end end ax end end def entries @entries.each do |key, value| yield key, value end end end
Version data entries
40 entries across 40 versions & 2 rubygems