diff options
| author | Paul Buetow <paul@buetow.org> | 2024-12-06 22:33:07 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-12-06 22:33:07 +0200 |
| commit | bfdcad7efca071374de0be3124dcc92deeab681e (patch) | |
| tree | 6215f6fcf5287f69840d06ad8c009dab0945ef6d /lib/autorequire/config.rb | |
| parent | 4a3629e42cb3e1fbca4356cf789a8e79043cdc51 (diff) | |
auto require
Diffstat (limited to 'lib/autorequire/config.rb')
| -rw-r--r-- | lib/autorequire/config.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/autorequire/config.rb b/lib/autorequire/config.rb new file mode 100644 index 0000000..b9dc5ac --- /dev/null +++ b/lib/autorequire/config.rb @@ -0,0 +1,18 @@ +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 +end |
