Class: Muwu::RenderHtmlPartialBuilder::DocumentHtmlBuilder
- Inherits:
-
Object
- Object
- Muwu::RenderHtmlPartialBuilder::DocumentHtmlBuilder
show all
- Includes:
- Muwu, Helper
- Defined in:
- lib/muwu/render_html_partial_builder/render_document_html_builder.rb
Constant Summary
Constants included
from Muwu
GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Muwu
debug, read
Constructor Details
Returns a new instance of DocumentHtmlBuilder.
22
23
24
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 22
def initialize
@renderer = RenderHtmlPartial::DocumentHtml.new
end
|
Instance Attribute Details
#renderer ⇒ Object
Returns the value of attribute renderer.
10
11
12
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 10
def renderer
@renderer
end
|
Class Method Details
.build {|builder| ... } ⇒ Object
15
16
17
18
19
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 15
def self.build
builder = new
yield(builder)
builder.renderer
end
|
Instance Method Details
#build_from_manifest_document(document) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 27
def build_from_manifest_document(document)
@document = document
@project = document.project
set_destination
set_html_lang
set_html_title
set_head_css_method
set_head_js_libraries
set_head_js_method
set_head_includes_metadata_tags
set_head_metadata
set_project
set_tasks
finally_set_css_filename
finally_set_js_filename
end
|
#finally_set_css_filename ⇒ Object
45
46
47
48
49
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 45
def finally_set_css_filename
if @renderer.head_css_method == :link
@renderer.head_css_filename = @document.css_filename
end
end
|
#finally_set_js_filename ⇒ Object
52
53
54
55
56
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 52
def finally_set_js_filename
if @renderer.head_js_method == :link
@renderer.head_js_filename = @document.js_filename
end
end
|
#set_destination ⇒ Object
59
60
61
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 59
def set_destination
@renderer.destination = @document.destination
end
|
#set_head_css_method ⇒ Object
86
87
88
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 86
def set_head_css_method
@renderer.head_css_method = @document.css_include_method
end
|
74
75
76
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 74
def set_head_includes_metadata_tags
@renderer.head_includes_metadata_tags = @project.options.html_head_includes_metadata_tags
end
|
#set_head_js_libraries ⇒ Object
91
92
93
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 91
def set_head_js_libraries
@renderer.head_js_libraries = @document.js_head_libraries
end
|
#set_head_js_method ⇒ Object
96
97
98
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 96
def set_head_js_method
@renderer.head_js_method = @document.js_include_method
end
|
79
80
81
82
83
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 79
def set_head_metadata
if @project.options.html_head_includes_metadata_tags
@renderer.head_metadata = SanitizerHelper::sanitize_metadata(@project.metadata)
end
end
|
#set_html_lang ⇒ Object
64
65
66
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 64
def set_html_lang
@renderer.html_lang = @project.options.html_lang
end
|
#set_html_title ⇒ Object
69
70
71
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 69
def set_html_title
@renderer.html_title = determine_html_title
end
|
#set_project ⇒ Object
101
102
103
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 101
def set_project
@renderer.project = @project
end
|
#set_tasks ⇒ Object
106
107
108
|
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 106
def set_tasks
@renderer.tasks = determine_document_tasks
end
|