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