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:
+9
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user