Class: JsDuck::Source::Writer
- Inherits:
-
Object
- Object
- JsDuck::Source::Writer
- Defined in:
- lib/jsduck/source/writer.rb
Overview
Writes HTML JavaScript/CSS source into HTML files.
Instance Method Summary collapse
-
#initialize(source_files) ⇒ Writer
constructor
A new instance of Writer.
-
#write(destination) ⇒ Object
Writes all source files as HTML files into destination dir.
Constructor Details
#initialize(source_files) ⇒ Writer
Returns a new instance of Writer.
10 11 12 |
# File 'lib/jsduck/source/writer.rb', line 10 def initialize(source_files) @source_files = source_files end |
Instance Method Details
#write(destination) ⇒ Object
Writes all source files as HTML files into destination dir.
15 16 17 18 19 20 21 22 23 |
# File 'lib/jsduck/source/writer.rb', line 15 def write(destination) generate_html_filenames FileUtils.mkdir(destination) Util::Parallel.each(@source_files) do |file| Logger.log("Writing source", file.html_filename) write_single(destination + "/" + file.html_filename, file.to_html) end end |