lib/hogan_assets/config.rb in hogan_assets-1.3.4 vs lib/hogan_assets/config.rb in hogan_assets-1.4.0
- old
+ new
@@ -6,27 +6,32 @@
# Or in a block:
#
# HoganAssets::Config.configure do |config|
# config.lambda_support = false
# config.path_prefix = 'templates'
- # config.template_extensions = ['mustache', 'hamstache']
+ # config.template_extensions = ['mustache', 'hamstache', 'slimstache']
# config.haml_options[:ugly] = true
+ # config.slim_options[:pretty] = false
# end
#
module Config
extend self
- attr_writer :lambda_support, :path_prefix, :template_extensions, :template_namespace, :haml_options
+ attr_writer :lambda_support, :path_prefix, :template_extensions, :template_namespace, :haml_options, :slim_options
def configure
yield self
end
def haml_available?
defined? ::Haml::Engine
end
+ def slim_available?
+ defined? ::Slim::Engine
+ end
+
def lambda_support?
@lambda_support
end
def path_prefix
@@ -36,17 +41,17 @@
def template_namespace
@template_namespace ||= 'HoganTemplates'
end
def template_extensions
- @template_extensions ||= if haml_available?
- ['mustache', 'hamstache']
- else
- ['mustache']
- end
+ @template_extensions ||= "mustache#{' hamstache' if haml_available?}#{' slimstache' if slim_available?}".split
end
def haml_options
@haml_options ||= {}
+ end
+
+ def slim_options
+ @slim_options ||= {}
end
end
end