Class: Cosmos::HandbookCreatorConfig
- Defined in:
- lib/cosmos/tools/handbook_creator/handbook_creator_config.rb
Overview
Reads an ascii file that defines the configuration settings used to configure the Handbook Creator
Defined Under Namespace
Instance Attribute Summary collapse
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
Instance Method Summary collapse
- #create_html(hide_ignored) ⇒ Object
- #create_pdf(hide_ignored, progress_dialog = nil) ⇒ Object
-
#initialize(filename) ⇒ HandbookCreatorConfig
constructor
Parses the configuration file.
Constructor Details
#initialize(filename) ⇒ HandbookCreatorConfig
Parses the configuration file.
257 258 259 260 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 257 def initialize(filename) @pages = [] process_file(filename) end |
Instance Attribute Details
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
22 23 24 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 22 def pages @pages end |
Instance Method Details
#create_html(hide_ignored) ⇒ Object
262 263 264 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 262 def create_html(hide_ignored) @pages.each {|page| page.create_html(hide_ignored)} end |
#create_pdf(hide_ignored, progress_dialog = nil) ⇒ Object
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 266 def create_pdf(hide_ignored, progress_dialog = nil) begin @pages.each_with_index do |page, index| progress_dialog.set_overall_progress(index.to_f / @pages.length.to_f) if progress_dialog page.create_pdf(hide_ignored, progress_dialog) end progress_dialog.set_overall_progress(1.0) if progress_dialog rescue Exception => err if err. == "Call to wkhtmltopdf failed" return false else raise err end end true end |