Module: Cuporter::Document
- Defined in:
- lib/cuporter/document.rb,
lib/cuporter/document/assets.rb,
lib/cuporter/document/html_document.rb
Defined Under Namespace
Modules: Assets
Classes: Html
Class Method Summary
collapse
Class Method Details
.new_html(view, link_assets, use_copied_public_assets) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/cuporter/document.rb', line 13
def self.new_html(view, link_assets, use_copied_public_assets)
doc = Cuporter::Document::Html.new
doc.view = view
doc.link_assets = link_assets
doc.assets_src = Assets::PUBLIC_SOURCE_PATH
doc.assets_base_path = Assets.base_path(use_copied_public_assets)
root = Nokogiri::XML::Node.new('html', doc)
root.create_internal_subset( 'html', "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd")
doc << root
doc
end
|
.new_xml ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/cuporter/document.rb', line 5
def self.new_xml
require 'cuporter/extensions/nokogiri'
doc = Nokogiri::XML::Document.new
doc << Nokogiri::XML::Node.new('xml', doc)
doc.root << Nokogiri::XML::Node.new('body', doc)
doc
end
|