class HamlCoffeeAssets::Configuration

Haml Coffee configuration object that contains the default values. It's a plain Ruby object so a Sinatra app doesn't have to depend on ActiveSupport just because of the Rails engine configuration.

Attributes

basename[RW]

Ignore path when generate the JST

cleanValue[RW]

Clean inline CoffeeScript values

context[RW]

Custom global context to merge

customCleanValue[RW]

Custom global code clean value function

customFindAndPreserve[RW]

Custom find and preserve function

customHtmlEscape[RW]

Custom global HTML escaping function

customPrecede[RW]

Custom global precede function

customPreserve[RW]

Custom preserve function

customReference[RW]

Custom object reference function

customSucceed[RW]

Custom global succeed function

customSurround[RW]

Custom global surround function

dependencies[RW]

Define the global amd module dependencies

escapeAttributes[RW]

Escape template code output for attributes

escapeHtml[RW]

Escape template code output

format[RW]

Template format, either html5, html4 or xhtml

global_context_asset[RW]

Path to custom helpers shared by Rails and JS.

name_filter[RW]

A proc that is called to modify the template name used as the JST key. The proc is passed the name as an argument and should return the modified name (or unmodified) name.

namespace[RW]

Template namespace

placement[RW]

Define the function placement, either `global` or `amd`

preserveTags[RW]

List of tags to preserve

selfCloseTags[RW]

List of self closing tags

templates_path[RW]

Path to templates shared by Rails and JS.

uglify[RW]

Uglify HTML output by skip indention

Public Class Methods

new() click to toggle source

Constructor with defaults

# File lib/haml_coffee_assets/configuration.rb, line 19
def initialize
  self.namespace              = 'window.JST'
  self.format                 = 'html5'
  self.uglify                 = false
  self.basename               = false
  self.escapeHtml             = true
  self.escapeAttributes       = true
  self.cleanValue             = true
  self.placement              = 'global'
  self.dependencies           = { hc: 'hamlcoffee_amd' }
  self.customHtmlEscape       = 'window.HAML.escape'
  self.customCleanValue       = 'window.HAML.cleanValue'
  self.customPreserve         = 'window.HAML.preserve'
  self.customFindAndPreserve  = 'window.HAML.findAndPreserve'
  self.customSurround         = 'window.HAML.surround'
  self.customSucceed          = 'window.HAML.succeed'
  self.customPrecede          = 'window.HAML.precede'
  self.customReference        = 'window.HAML.reference'
  self.preserveTags           = 'textarea,pre'
  self.selfCloseTags          = 'meta,img,link,br,hr,input,area,param,col,base'
  self.context                = 'window.HAML.context'
  self.templates_path         = 'app/assets/javascripts/templates'
  self.global_context_asset   = 'templates/context.js'
  self.name_filter            = lambda { |n|
    parts = n.sub(/^templates\//, '').split('/')
    parts.last.sub!(/^_/, '')
    parts.join('/')
  }
end