Sha256: a44e0b3193b16b33abccbd49e2d4e18f080d8aba6d93d5a979379e1564670ac5

Contents?: true

Size: 544 Bytes

Versions: 29

Compression:

Stored size: 544 Bytes

Contents

module Cody
  module Variables
    def load_variables
      load_variables_file("base")
      load_variables_file(Cody.env)
      # Then load type scope variables, so they take higher precedence
      load_variables_file("base", @options[:type])
      load_variables_file(Cody.env, @options[:type])
    end

    def load_variables_file(filename, type=nil)
      items = ["#{Cody.root}/.cody", type, "variables/#{filename}.rb"].compact
      path = items.join('/')
      instance_eval(IO.read(path), path) if File.exist?(path)
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
cody-1.2.1 lib/cody/variables.rb
cody-1.1.0 lib/cody/variables.rb
cody-1.0.6 lib/cody/variables.rb
cody-1.0.5 lib/cody/variables.rb
cody-1.0.4 lib/cody/variables.rb
cody-1.0.3 lib/cody/variables.rb
cody-1.0.2 lib/cody/variables.rb
cody-1.0.1 lib/cody/variables.rb
cody-1.0.0 lib/cody/variables.rb
cody-0.9.8 lib/cody/variables.rb
cody-0.9.7 lib/cody/variables.rb
cody-0.9.6 lib/cody/variables.rb
cody-0.9.5 lib/cody/variables.rb
cody-0.9.4 lib/cody/variables.rb
cody-0.9.3 lib/cody/variables.rb
cody-0.9.2 lib/cody/variables.rb
cody-0.9.1 lib/cody/variables.rb
cody-0.9.0 lib/cody/variables.rb
cody-0.8.6 lib/cody/variables.rb
cody-0.8.5 lib/cody/variables.rb