Class: RETerm::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/reterm/config.rb

Constant Summary collapse

CONFIG_FILE =
File.expand_path("~/.reterm")

Class Method Summary collapse

Class Method Details

.getObject



7
8
9
10
11
12
13
# File 'lib/reterm/config.rb', line 7

def self.get
  @config ||=
    begin
      return {} unless File.exist?(CONFIG_FILE)
      JSON.parse(File.read(CONFIG_FILE))
    end
end

.load_pluginsObject



15
16
17
18
19
20
# File 'lib/reterm/config.rb', line 15

def self.load_plugins
  return unless get.key?("plugins")
  get["plugins"].each { |p|
    require p
  }
end