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 ⇒ Object
- #create_pdf(progress_dialog = nil) ⇒ Object
-
#initialize(filename) ⇒ HandbookCreatorConfig
constructor
Parses the configuration file.
Constructor Details
#initialize(filename) ⇒ HandbookCreatorConfig
Parses the configuration file.
233 234 235 236 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 233 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 ⇒ Object
238 239 240 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 238 def create_html @pages.each {|page| page.create_html} end |
#create_pdf(progress_dialog = nil) ⇒ Object
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/cosmos/tools/handbook_creator/handbook_creator_config.rb', line 242 def create_pdf(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(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 |