lib/hogan_assets/config.rb in hogan_assets-1.0.3 vs lib/hogan_assets/config.rb in hogan_assets-1.1.0

- old
+ new

@@ -1,24 +1,35 @@ module HoganAssets # Change config options in an initializer: # - # HoganAssets.template_extension = 'mustache' + # HoganAssets::Config.template_extensions = ['mustache'] # # Or in a block: # - # HoganAssets.configure do |config| - # config.template_extension = 'mustache' + # HoganAssets::Config.configure do |config| + # config.template_extensions = ['mustache'] # end module Config - attr_accessor :template_base_path, :template_extension + extend self def configure yield self end - def template_extension - @template_extension ||= 'mustache' + attr_accessor :allow_hamstache + + attr_writer :template_extensions + + def template_extensions + @template_extensions ||= if haml_available? + ['mustache', 'hamstache'] + else + ['mustache'] + end end + + def haml_available? + defined? ::Haml::Engine + end end end -