Class: RubyScreen::PreferencesLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_screen/preferences_loader.rb

Class Method Summary collapse

Class Method Details

.loadObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ruby_screen/preferences_loader.rb', line 6

def self.load
  begin
    configuration_string = IO.read(default_preferences_file)
    processed_string = ERB.new(configuration_string).result
    YAML.load(processed_string)
  rescue
    Kernel.abort <<-EOS
There was a problem loading your preferences file.  I expect you to have an
environment variable called "HOME" which holds the path to your home directory,
and in that directory there should be the YAML file ".ruby-screen.yml"
    EOS
  end
end