Class: JsDuck::Web::Template
- Inherits:
-
Object
- Object
- JsDuck::Web::Template
- Defined in:
- lib/jsduck/web/template.rb
Overview
Copies over the template directory.
Or links when –template-links option specified.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Template
constructor
A new instance of Template.
- #write ⇒ Object
Constructor Details
#initialize(opts) ⇒ Template
Returns a new instance of Template.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jsduck/web/template.rb', line 11 def initialize(opts) @opts = opts @files = [ "app", "app*.js", "favicon.ico", "extjs", "resources", ] end |
Instance Method Details
#write ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jsduck/web/template.rb', line 22 def write if @opts.template_links Logger.log("Linking template files to", @opts.output) move_files(:symlink) else Logger.log("Copying template files to", @opts.output) move_files(:cp_r) end # always copy the eg-iframe file. eg_iframe = @opts.eg_iframe || @opts.template+"/eg-iframe.html" FileUtils.cp(eg_iframe, @opts.output+"/eg-iframe.html") end |