class Spore::Environment::Substitutions

Constants

PATTERN

Public Class Methods

call(value) click to toggle source
# File lib/spore/environment.rb, line 36
def self.call(value)
  value.gsub(PATTERN) do |variable|
    replace(variable, variable.match(PATTERN))
  end
end

Private Class Methods

replace(value, match) click to toggle source
# File lib/spore/environment.rb, line 42
                     def self.replace(value, match)
  return value[1..-1] unless match[:escape].empty?
  return value[1..-1] unless match[:ocurl].empty? == match[:ccurl].empty?
  ENV[match[:variable]]
end