Class: JsDuck::Web::IndexHtml
- Inherits:
-
Object
- Object
- JsDuck::Web::IndexHtml
- Defined in:
- lib/jsduck/web/index_html.rb
Overview
Deals with creation of main HTML or PHP files.
Instance Method Summary collapse
-
#initialize(assets, opts, paths = {}) ⇒ IndexHtml
constructor
A new instance of IndexHtml.
-
#write ⇒ Object
In normal mode creates index.html.
Constructor Details
#initialize(assets, opts, paths = {}) ⇒ IndexHtml
Returns a new instance of IndexHtml.
12 13 14 15 16 |
# File 'lib/jsduck/web/index_html.rb', line 12 def initialize(assets, opts, paths={}) @assets = assets @opts = opts @paths = paths end |
Instance Method Details
#write ⇒ Object
In normal mode creates index.html.
When –seo enabled, creates index.php, template.html and print-template.html.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/jsduck/web/index_html.rb', line 21 def write if @opts.seo FileUtils.cp(@opts.template+"/index.php", @opts.output+"/index.php") create_template_html(@opts.template+"/template.html", @opts.output+"/template.html") create_print_template_html(@opts.template+"/print-template.html", @opts.output+"/print-template.html") create_index_template_html(@opts.template+"/index-template.html", @opts.output+"/index-template.html") else create_template_html(@opts.template+"/template.html", @opts.output+"/index.html") end end |