Class: JsDuck::Web::Source
- Inherits:
-
Object
- Object
- JsDuck::Web::Source
- Defined in:
- lib/jsduck/web/source.rb
Overview
Writes HTML JavaScript/CSS source into HTML files.
Instance Method Summary collapse
-
#initialize(source_files) ⇒ Source
constructor
A new instance of Source.
-
#write(destination) ⇒ Object
Writes all source files as HTML files into destination dir.
Constructor Details
#initialize(source_files) ⇒ Source
Returns a new instance of Source.
10 11 12 |
# File 'lib/jsduck/web/source.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/web/source.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 |