Sha256: e9782e8b11b3324e30a7c48638c3c7b54d0a41fd7a295856f6d568cce210d436

Contents?: true

Size: 482 Bytes

Versions: 5

Compression:

Stored size: 482 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"
  # config path
  CONFIG_PATH = "#{OGRE_HOME}/config.json"

  # 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

5 entries across 5 versions & 1 rubygems

Version Path
ogre-0.1.4 lib/ogre/config.rb
ogre-0.1.3 lib/ogre/config.rb
ogre-0.1.2 lib/ogre/config.rb
ogre-0.1.1 lib/ogre/config.rb
ogre-0.1.0 lib/ogre/config.rb