module Rufo::Settings
def init_settings(options)
def init_settings(options) OPTIONS.each do |name, valid_options| default = valid_options.first value = options.fetch(name, default) unless valid_options.include?(value) $stderr.puts "Invalid value for #{name}: #{value.inspect}. Valid " \ "values are: #{valid_options.map(&:inspect).join(', ')}" value = default end self.public_send("#{name}=", value) end diff = options.keys - OPTIONS.keys diff.each do |key| $stderr.puts "Invalid config option=#{key}" end end