Override the lookup method for now, because we often call it with empty default and empty scope anyway.

configuration-in-hiera
Robert Gerus 2015-04-16 10:04:18 +02:00
parent d5d6f7f12a
commit 50ce39da5c
1 changed files with 9 additions and 1 deletions

10
run.rb
View File

@ -24,12 +24,20 @@ hiera_configuration = {
],
}
Config = Hiera.new(config: hiera_configuration)
class ConfigSource < Hiera
def lookup key, default="", scope=nil, *stuff
super
end
end
Config = ConfigSource.new(config: hiera_configuration)
# Will have to change it to a normal EM loop if/when i'll want to make a usable
# local console for the bot.
Client = Repost.new do
scope = { "network" => "freenode" }
host Config.lookup("server::host", "", scope)
port Config.lookup("server::port", "", scope)