Module: ChromeDiff

Defined in:
lib/chrome_diff.rb,
lib/chrome_diff/cli.rb,
lib/chrome_diff/session.rb,
lib/chrome_diff/version.rb,
lib/chrome_diff/site_checker.rb

Defined Under Namespace

Classes: CLI, CompareStatus, Error, Session, SiteChecker

Constant Summary collapse

DEFAULT_OPTIONS =
{
  output: "diff.png",
  width: 800,
  height: 600,
  threshold: 1,
  timeout: 5,
}
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.run(**args) ⇒ Object



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

def self.run(**args)
  width = args.delete(:width)
  height = args.delete(:height)
  timeout = args.delete(:timeout)
  debug = args.delete(:debug)

  begin
    session = ChromeDiff::Session.new(width: width, height: height, timeout: timeout, debug: debug)
    session.compare(**args)
  ensure
    session.browser&.quit
  end
end