Class: HamlCoffeeAssets::Configuration
- Inherits:
-
Object
- Object
- HamlCoffeeAssets::Configuration
- Defined in:
- lib/haml_coffee_assets/configuration.rb
Overview
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.
Instance Attribute Summary collapse
-
#basename ⇒ Object
Ignore path when generate the JST.
-
#cleanValue ⇒ Object
Clean inline CoffeeScript values.
-
#context ⇒ Object
Custom global context to merge.
-
#customCleanValue ⇒ Object
Custom global code clean value function.
-
#customFindAndPreserve ⇒ Object
Custom find and preserve function.
-
#customHtmlEscape ⇒ Object
Custom global HTML escaping function.
-
#customPrecede ⇒ Object
Custom global precede function.
-
#customPreserve ⇒ Object
Custom preserve function.
-
#customReference ⇒ Object
Custom object reference function.
-
#customSucceed ⇒ Object
Custom global succeed function.
-
#customSurround ⇒ Object
Custom global surround function.
-
#dependencies ⇒ Object
Define the global amd module dependencies.
-
#escapeAttributes ⇒ Object
Escape template code output for attributes.
-
#escapeHtml ⇒ Object
Escape template code output.
-
#format ⇒ Object
Template format, either html5, html4 or xhtml.
-
#global_context_asset ⇒ Object
Path to custom helpers shared by Rails and JS.
-
#name_filter ⇒ Object
A proc that is called to modify the template name used as the JST key.
-
#namespace ⇒ Object
Template namespace.
-
#placement ⇒ Object
Define the function placement, either ‘global` or `amd`.
-
#preserveTags ⇒ Object
List of tags to preserve.
-
#selfCloseTags ⇒ Object
List of self closing tags.
-
#templates_path ⇒ Object
Path to templates shared by Rails and JS.
-
#uglify ⇒ Object
Uglify HTML output by skip indention.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Constructor with defaults.
Constructor Details
#initialize ⇒ Configuration
Constructor with defaults
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# 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 |
Instance Attribute Details
#basename ⇒ Object
Ignore path when generate the JST
63 64 65 |
# File 'lib/haml_coffee_assets/configuration.rb', line 63 def basename @basename end |
#cleanValue ⇒ Object
Clean inline CoffeeScript values
75 76 77 |
# File 'lib/haml_coffee_assets/configuration.rb', line 75 def cleanValue @cleanValue end |
#context ⇒ Object
Custom global context to merge
127 128 129 |
# File 'lib/haml_coffee_assets/configuration.rb', line 127 def context @context end |
#customCleanValue ⇒ Object
Custom global code clean value function
91 92 93 |
# File 'lib/haml_coffee_assets/configuration.rb', line 91 def customCleanValue @customCleanValue end |
#customFindAndPreserve ⇒ Object
Custom find and preserve function
115 116 117 |
# File 'lib/haml_coffee_assets/configuration.rb', line 115 def customFindAndPreserve @customFindAndPreserve end |
#customHtmlEscape ⇒ Object
Custom global HTML escaping function
87 88 89 |
# File 'lib/haml_coffee_assets/configuration.rb', line 87 def customHtmlEscape @customHtmlEscape end |
#customPrecede ⇒ Object
Custom global precede function
103 104 105 |
# File 'lib/haml_coffee_assets/configuration.rb', line 103 def customPrecede @customPrecede end |
#customPreserve ⇒ Object
Custom preserve function
107 108 109 |
# File 'lib/haml_coffee_assets/configuration.rb', line 107 def customPreserve @customPreserve end |
#customReference ⇒ Object
Custom object reference function
111 112 113 |
# File 'lib/haml_coffee_assets/configuration.rb', line 111 def customReference @customReference end |
#customSucceed ⇒ Object
Custom global succeed function
99 100 101 |
# File 'lib/haml_coffee_assets/configuration.rb', line 99 def customSucceed @customSucceed end |
#customSurround ⇒ Object
Custom global surround function
95 96 97 |
# File 'lib/haml_coffee_assets/configuration.rb', line 95 def customSurround @customSurround end |
#dependencies ⇒ Object
Define the global amd module dependencies
83 84 85 |
# File 'lib/haml_coffee_assets/configuration.rb', line 83 def dependencies @dependencies end |
#escapeAttributes ⇒ Object
Escape template code output for attributes
71 72 73 |
# File 'lib/haml_coffee_assets/configuration.rb', line 71 def escapeAttributes @escapeAttributes end |
#escapeHtml ⇒ Object
Escape template code output
67 68 69 |
# File 'lib/haml_coffee_assets/configuration.rb', line 67 def escapeHtml @escapeHtml end |
#format ⇒ Object
Template format, either html5, html4 or xhtml
55 56 57 |
# File 'lib/haml_coffee_assets/configuration.rb', line 55 def format @format end |
#global_context_asset ⇒ Object
Path to custom helpers shared by Rails and JS.
141 142 143 |
# File 'lib/haml_coffee_assets/configuration.rb', line 141 def global_context_asset @global_context_asset end |
#name_filter ⇒ Object
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.
133 134 135 |
# File 'lib/haml_coffee_assets/configuration.rb', line 133 def name_filter @name_filter end |
#namespace ⇒ Object
Template namespace
51 52 53 |
# File 'lib/haml_coffee_assets/configuration.rb', line 51 def namespace @namespace end |
#placement ⇒ Object
Define the function placement, either ‘global` or `amd`
79 80 81 |
# File 'lib/haml_coffee_assets/configuration.rb', line 79 def placement @placement end |
#preserveTags ⇒ Object
List of tags to preserve
119 120 121 |
# File 'lib/haml_coffee_assets/configuration.rb', line 119 def preserveTags @preserveTags end |
#selfCloseTags ⇒ Object
List of self closing tags
123 124 125 |
# File 'lib/haml_coffee_assets/configuration.rb', line 123 def selfCloseTags @selfCloseTags end |
#templates_path ⇒ Object
Path to templates shared by Rails and JS.
137 138 139 |
# File 'lib/haml_coffee_assets/configuration.rb', line 137 def templates_path @templates_path end |
#uglify ⇒ Object
Uglify HTML output by skip indention
59 60 61 |
# File 'lib/haml_coffee_assets/configuration.rb', line 59 def uglify @uglify end |