lib/squib/deck.rb in squib-0.4.0 vs lib/squib/deck.rb in squib-0.5.0
- old
+ new
@@ -32,11 +32,11 @@
# @api private
attr_reader :text_hint, :antialias
# :nodoc:
# @api private
- attr_reader :layout, :config
+ attr_reader :layout, :config, :quote_chars
attr_reader :dir, :prefix, :count_format
# Squib's constructor that sets the immutable properties.
#
@@ -68,10 +68,11 @@
@text_hint = :off
@backend = :memory
@dir = SYSTEM_DEFAULTS[:dir]
@prefix = SYSTEM_DEFAULTS[:prefix]
@count_format = SYSTEM_DEFAULTS[:count_format]
+ @quote_chars = CONFIG_DEFAULTS.select {|k,v| %w(lsquote rsquote ldquote rdquote em_dash en_dash ellipsis smart_quotes).include?(k) }
show_info(config, layout)
load_config(config)
@width = Args::UnitConversion.parse width, dpi
@height = Args::UnitConversion.parse height, dpi
cards.times{ |i| @cards << Squib::Card.new(self, @width, @height, @backend, i) }
@@ -109,9 +110,13 @@
@backend = (config['backend'].to_s.downcase.strip == 'svg') ? :svg : :memory
@dir = config['dir']
@prefix = config['prefix']
@count_format = config['count_format']
@antialias = config['antialias']
+ @quote_chars ||= {}
+ %w(lsquote rsquote ldquote rdquote smart_quotes em_dash en_dash ellipsis).each do |key|
+ @quote_chars[key] = config[key]
+ end
end
end
# Use Logger to show more detail on the run
# :nodoc: