module Codebuild::Variables

Public Instance Methods

load_variables() click to toggle source
# File lib/codebuild/variables.rb, line 3
def load_variables
  load_variables_file("base")
  load_variables_file(Codebuild.env)
  # Then load type scope variables, so they take higher precedence
  load_variables_file("base", @options[:type])
  load_variables_file(Codebuild.env, @options[:type])
end
load_variables_file(filename, type=nil) click to toggle source
# File lib/codebuild/variables.rb, line 11
def load_variables_file(filename, type=nil)
  items = ["#{Codebuild.root}/.codebuild", type, "variables/#{filename}.rb"].compact
  path = items.join('/')
  instance_eval(IO.read(path), path) if File.exist?(path)
end