lib/hogan_assets/config.rb in hogan_assets-1.5.0 vs lib/hogan_assets/config.rb in hogan_assets-1.5.1

- old
+ new

@@ -36,11 +36,12 @@ # <<: *defaults # module Config extend self - attr_writer :env, :lambda_support, :path_prefix, :template_extensions, :template_namespace, :haml_options, :slim_options + attr_writer :env, :lambda_support, :path_prefix, :template_extensions, :template_namespace, :haml_options, :slim_options, + :slimstache_extensions, :hamstache_extensions def configure yield self end @@ -71,10 +72,12 @@ @path_prefix = yml['path_prefix'] if yml.has_key? 'path_prefix' @template_extensions = yml['template_extensions'] if yml.has_key? 'template_extensions' @template_namespace = yml['template_namespace'] if yml.has_key? 'template_namespace' @haml_options = yml['haml_options'] if yml.has_key? 'haml_options' @slim_options = yml['slim_options'] if yml.has_key? 'slim_options' + @slimstache_extensions = yml['slimstache_extensions'] if yml.has_key? 'slimstache_extensions' + @hamstache_extensions = yml['hamstache_extensions'] if yml.has_key? 'hamstache_extensions' symbolize(@haml_options) if @haml_options symbolize(@slim_options) if @slim_options end def path_prefix @@ -93,9 +96,17 @@ @template_namespace ||= 'HoganTemplates' end def template_extensions @template_extensions ||= "mustache#{' hamstache' if haml_available?}#{' slimstache' if slim_available?}".split + end + + def hamstache_extensions + @hamstache_extensions ||= ['hamstache'] + end + + def slimstache_extensions + @slimstache_extensions ||= ['slimstache'] end def yml begin @yml ||= (YAML.load(IO.read yml_path)[env] rescue nil) || {}