summaryrefslogtreecommitdiff
path: root/lib/config.rb
blob: b0123e0948ff34e50bb6f1ca74c8c774013daae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'toml'

module RCM
  # Configuration
  module Config
    @@config = File.exist?('config.toml') ? TOML.load_file('config.toml') : {}

    def config(key)
      raise "No such config key: #{key}" unless @@config.key?(key)

      @@config[key]
    end

    def dump_config = p @@config
  end
end