class Config
Constants
- REQUIRED_STRUCTURE
Public Class Methods
all_keys(hash)
click to toggle source
# File lib/r5/config.rb, line 33 def self.all_keys(hash) hash.flat_map { |k, v| [k] + (v.is_a?(Hash) ? all_keys(v) : []) } end
check_settings()
click to toggle source
TODO Space for improving structure check - now it is very simple and won't work properly for duplicated keys in deeper structure
# File lib/r5/config.rb, line 29 def self.check_settings all_keys(REQUIRED_STRUCTURE) - all_keys(settings) end
settings()
click to toggle source
# File lib/r5/config.rb, line 19 def self.settings if File.exists? "#{ENV['HOME']}/.r5.yml" YAML::load_file("#{ENV['HOME']}/.r5.yml") else 'You need to create ~/.r5.yml file, check github for example.' end end