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.
-
#customSucceed ⇒ Object
Custom global succeed function.
-
#customSurround ⇒ Object
Custom global surround function.
-
#escapeAttributes ⇒ Object
Escape template code output for attributes.
-
#escapeHtml ⇒ Object
Escape template code output.
-
#extendScope ⇒ Object
Extend the template scope with the context.
-
#format ⇒ Object
Template format, either html5, html4 or xhtml.
-
#name_filter ⇒ Object
A proc that is called to modify the template name used as the JST key.
-
#namespace ⇒ Object
Template namespace.
-
#preserveTags ⇒ Object
List of tags to preserve.
-
#selfCloseTags ⇒ Object
List of self closing tags.
-
#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
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/haml_coffee_assets/configuration.rb', line 11 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.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.preserveTags = 'textarea,pre' self.selfCloseTags = 'meta,img,link,br,hr,input,area,param,col,base' self.context = 'window.HAML.context' self.extendScope = false self.name_filter = lambda { |n| n.sub /^templates\//, '' } end |
Instance Attribute Details
#basename ⇒ Object
Ignore path when generate the JST
47 48 49 |
# File 'lib/haml_coffee_assets/configuration.rb', line 47 def basename @basename end |
#cleanValue ⇒ Object
Clean inline CoffeeScript values
59 60 61 |
# File 'lib/haml_coffee_assets/configuration.rb', line 59 def cleanValue @cleanValue end |
#context ⇒ Object
Custom global context to merge
99 100 101 |
# File 'lib/haml_coffee_assets/configuration.rb', line 99 def context @context end |
#customCleanValue ⇒ Object
Custom global code clean value function
67 68 69 |
# File 'lib/haml_coffee_assets/configuration.rb', line 67 def customCleanValue @customCleanValue end |
#customFindAndPreserve ⇒ Object
Custom find and preserve function
87 88 89 |
# File 'lib/haml_coffee_assets/configuration.rb', line 87 def customFindAndPreserve @customFindAndPreserve end |
#customHtmlEscape ⇒ Object
Custom global HTML escaping function
63 64 65 |
# File 'lib/haml_coffee_assets/configuration.rb', line 63 def customHtmlEscape @customHtmlEscape end |
#customPrecede ⇒ Object
Custom global precede function
79 80 81 |
# File 'lib/haml_coffee_assets/configuration.rb', line 79 def customPrecede @customPrecede end |
#customPreserve ⇒ Object
Custom preserve function
83 84 85 |
# File 'lib/haml_coffee_assets/configuration.rb', line 83 def customPreserve @customPreserve end |
#customSucceed ⇒ Object
Custom global succeed function
75 76 77 |
# File 'lib/haml_coffee_assets/configuration.rb', line 75 def customSucceed @customSucceed end |
#customSurround ⇒ Object
Custom global surround function
71 72 73 |
# File 'lib/haml_coffee_assets/configuration.rb', line 71 def customSurround @customSurround end |
#escapeAttributes ⇒ Object
Escape template code output for attributes
55 56 57 |
# File 'lib/haml_coffee_assets/configuration.rb', line 55 def escapeAttributes @escapeAttributes end |
#escapeHtml ⇒ Object
Escape template code output
51 52 53 |
# File 'lib/haml_coffee_assets/configuration.rb', line 51 def escapeHtml @escapeHtml end |
#extendScope ⇒ Object
Extend the template scope with the context
103 104 105 |
# File 'lib/haml_coffee_assets/configuration.rb', line 103 def extendScope @extendScope end |
#format ⇒ Object
Template format, either html5, html4 or xhtml
39 40 41 |
# File 'lib/haml_coffee_assets/configuration.rb', line 39 def format @format 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.
109 110 111 |
# File 'lib/haml_coffee_assets/configuration.rb', line 109 def name_filter @name_filter end |
#namespace ⇒ Object
Template namespace
35 36 37 |
# File 'lib/haml_coffee_assets/configuration.rb', line 35 def namespace @namespace end |
#preserveTags ⇒ Object
List of tags to preserve
91 92 93 |
# File 'lib/haml_coffee_assets/configuration.rb', line 91 def preserveTags @preserveTags end |
#selfCloseTags ⇒ Object
List of self closing tags
95 96 97 |
# File 'lib/haml_coffee_assets/configuration.rb', line 95 def selfCloseTags @selfCloseTags end |
#uglify ⇒ Object
Uglify HTML output by skip indention
43 44 45 |
# File 'lib/haml_coffee_assets/configuration.rb', line 43 def uglify @uglify end |