Sha256: fa9640a1eae875949bdf1911abee5fad4b6c7ed435c135321bf9d439c4e8e8b6

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

require 'fileutils'

# This is a simple class that puts options from a config file
# into an accessible object
module Ogre
  # ogre home
  OGRE_HOME = "#{ENV['HOME']}/.ogre".freeze
  # config path
  CONFIG_PATH = "#{OGRE_HOME}/config.json".freeze
  # default chef policy repo
  REPO_URL = 'https://github.com/activenetwork-automation/code_generator'.freeze

  # Static method to make config parameters available
  class Config
    # Read in defaults from config file
    def self.options
      (JSON.parse(File.read(CONFIG_PATH), symbolize_names: true) if File.exist?(CONFIG_PATH)) || {}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ogre-0.1.7 lib/ogre/config.rb
ogre-0.1.6 lib/ogre/config.rb