Class: Docapurl::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/docapurl.rb

Overview

Your code goes here…

Instance Method Summary collapse

Instance Method Details

#cap(url, path = nil) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/docapurl.rb', line 18

def cap(url, path = nil)
  browser_options = {
    xvfb: options.xvfb,
    headless: options.headless,
    browser_path: options.browser_path
  }.reject { |_, v| v.nil? }

  Docapurl::Browser.cap(url, path, browser_options,
                        { max_pagedown: options.max_pagedown,
                          sleep_before_screen: options.sleep_before_screen,
                          pagedown_to_bottom: options.pagedown_to_bottom })
end