Class: Muwu::RenderHtmlPartialBuilder::DocumentHtmlBuilder

Inherits:
Object
  • Object
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

#initializeDocumentHtmlBuilder

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

#rendererObject

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

Yields:

  • (builder)


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_project
  set_tasks
  finally_set_css_filename
  finally_set_js_filename
end

#finally_set_css_filenameObject



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_filenameObject



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_destinationObject



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_methodObject



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

#set_head_includes_metadata_tagsObject



74
75
76
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 74

def 
  @renderer. = @project.options.
end

#set_head_js_librariesObject



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_methodObject



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

#set_head_metadataObject



79
80
81
82
83
# File 'lib/muwu/render_html_partial_builder/render_document_html_builder.rb', line 79

def 
  if @project.options.
    @renderer. = SanitizerHelper::(@project.)
  end
end

#set_html_langObject



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_titleObject



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_projectObject



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_tasksObject



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