Class: MakePDF::FirefoxPDFWriter
- Includes:
- CommandBased::Arguments
- Defined in:
- lib/make_pdf/firefox.rb
Instance Attribute Summary
Attributes included from CommandBased::Arguments
Attributes inherited from PDFWriter
#logger, #output_dir, #source_url
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ FirefoxPDFWriter
constructor
A new instance of FirefoxPDFWriter.
- #setup ⇒ Object
- #write(url, output) ⇒ Object
Methods included from CommandBased::Arguments
Methods inherited from PDFWriter
#make_output_filename, #make_pdf_filename, #make_relative_file, #make_source_url, #process
Methods included from PathManip
Constructor Details
#initialize(options) ⇒ FirefoxPDFWriter
Returns a new instance of FirefoxPDFWriter.
14 15 16 17 18 19 |
# File 'lib/make_pdf/firefox.rb', line 14 def initialize() Processor.logger.info('MakePDF firefox:', ) @args = make_arguments(**) @driver_opts = Selenium::WebDriver::Firefox::Options.new(args: @opts) setup end |
Class Method Details
.prefix ⇒ Object
10 11 12 |
# File 'lib/make_pdf/firefox.rb', line 10 def self.prefix '-' end |
Instance Method Details
#setup ⇒ Object
21 22 23 24 |
# File 'lib/make_pdf/firefox.rb', line 21 def setup Processor.logger.info('MakePDF firefox: start driver') @driver = Selenium::WebDriver.for :firefox, capabilities: @driver_opts end |
#write(url, output) ⇒ Object
26 27 28 29 |
# File 'lib/make_pdf/firefox.rb', line 26 def write(url, output) @driver.get(url) @driver.save_print_page output end |