class Ocular::Settings
Attributes
settings[RW]
Public Class Methods
find_settings_file_from_system(filename)
click to toggle source
# File lib/ocular/settings.rb, line 14 def self.find_settings_file_from_system(filename) if ENV['OCULAR_SETTINGS'] != nil filename = File.expand_path(ENV['OCULAR_SETTINGS']) end if !filename or !File.exists?(filename) filename = File.expand_path('~/.ocular.yaml') end if !filename or !File.exists?(filename) filename = File.expand_path('/etc/ocular.yaml') end return filename end
get(key)
click to toggle source
# File lib/ocular/settings.rb, line 35 def self.get(key) return @settings[key] end
load_from_file(filename)
click to toggle source
# File lib/ocular/settings.rb, line 30 def self.load_from_file(filename) ::Ocular.logger.debug "Loaded settings from #{filename}" @settings = ::Ocular::deep_symbolize(YAML::load_file(filename)) end
new()
click to toggle source
# File lib/ocular/settings.rb, line 11 def initialize() end