Class: HtmlMockup::MockupTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- HtmlMockup::MockupTemplate
show all
- Defined in:
- lib/html_mockup/mockup_template.rb
Defined Under Namespace
Classes: MissingPartial, TemplateContext
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#scanner ⇒ Object
Returns the value of attribute scanner.
16
17
18
|
# File 'lib/html_mockup/mockup_template.rb', line 16
def scanner
@scanner
end
|
Class Method Details
.engine_initialized? ⇒ Boolean
18
19
20
|
# File 'lib/html_mockup/mockup_template.rb', line 18
def self.engine_initialized?
true
end
|
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/html_mockup/mockup_template.rb', line 26
def evaluate(scope, locals, &block)
@scanner = StringScanner.new(data)
out = ""
while (partial = self.parse_partial_tag!) do
name, params, scanned = partial
out << scanned
current_content = self.scanner.scan_until(/<!-- \[STOP:#{name}\] -->/)
out << (render_partial(name, params, scope) || current_content)
end
out << scanner.rest
@output = out
end
|
#prepare ⇒ Object
22
23
24
|
# File 'lib/html_mockup/mockup_template.rb', line 22
def prepare
end
|