dsl: add Squib.configure

I ended up adding this one on a whim, but it feels like a long time coming. We need cleaner support for Rakefiles, and this is a good step toward that I think.
This commit is contained in:
Andy Meneely
2016-11-17 21:11:12 -05:00
parent 738aab3997
commit 56b5a711e4
6 changed files with 51 additions and 2 deletions
+9 -1
View File
@@ -3,6 +3,14 @@ require 'yaml'
require_relative 'args/typographer'
module Squib
USER_CONFIG = {}
def configure(opts)
str_hash = opts.inject({}) { |h, (k, v)| h[k.to_s] = v; h }
USER_CONFIG.merge! str_hash
end
module_function :configure
# @api private
class Conf
@@ -40,7 +48,7 @@ module Squib
}
def initialize(config_hash = DEFAULTS)
@config_hash = config_hash
@config_hash = config_hash.merge USER_CONFIG # programmatic overrides yml
@typographer = Args::Typographer.new(config_hash)
normalize_antialias
end