lib/squib/conf.rb in squib-0.11.0 vs lib/squib/conf.rb in squib-0.12.0

- old
+ new

@@ -1,10 +1,18 @@ require 'forwardable' 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 DEFAULTS = { 'antialias' => 'best', @@ -38,10 +46,10 @@ 'gray' => 'gray', 'subpixel' => 'subpixel' } 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 # Load the configuration file, if exists, overriding hardcoded defaults