Class: Bidi2pdf::Launcher
- Inherits:
-
Object
- Object
- Bidi2pdf::Launcher
- Defined in:
- lib/bidi2pdf/launcher.rb
Overview
Represents a launcher for managing browser sessions and executing tasks using the Bidi2pdf library. This class handles the setup and teardown of browser sessions, as well as the execution of tasks within those sessions.
Instance Method Summary collapse
-
#initialize(url:, inputfile:, output:, cookies:, headers:, auth:, headless: true, port: 0, wait_window_loaded: false, wait_network_idle: false, print_options: {}, remote_browser_url: nil, network_log_format: :console) ⇒ Launcher
constructor
rubocop:disable Metrics/ParameterLists.
-
#launch ⇒ Object
rubocop:enable Metrics/ParameterLists.
- #stop ⇒ Object
Constructor Details
#initialize(url:, inputfile:, output:, cookies:, headers:, auth:, headless: true, port: 0, wait_window_loaded: false, wait_network_idle: false, print_options: {}, remote_browser_url: nil, network_log_format: :console) ⇒ Launcher
rubocop:disable Metrics/ParameterLists
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bidi2pdf/launcher.rb', line 40 def initialize(url:, inputfile:, output:, cookies:, headers:, auth:, headless: true, port: 0, wait_window_loaded: false, wait_network_idle: false, print_options: {}, remote_browser_url: nil, network_log_format: :console) @url = url @inputfile = inputfile @port = port @headless = headless @output = output = @headers = headers @auth = auth @manager = nil @wait_window_loaded = wait_window_loaded @wait_network_idle = wait_network_idle = || {} @remote_browser_url = remote_browser_url @custom_session = nil @network_log_format = network_log_format end |
Instance Method Details
#launch ⇒ Object
rubocop:enable Metrics/ParameterLists
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/bidi2pdf/launcher.rb', line 61 def launch runner = SessionRunner.new( session: session, url: @url, inputfile: @inputfile, output: @output, cookies: , headers: @headers, auth: @auth, wait_window_loaded: @wait_window_loaded, wait_network_idle: @wait_network_idle, print_options: , network_log_format: @network_log_format ) runner.run end |
#stop ⇒ Object
78 79 80 81 |
# File 'lib/bidi2pdf/launcher.rb', line 78 def stop @manager&.stop @custom_session&.close end |