class Rundoc::CodeCommand::Website::Screenshot

Public Class Methods

new(name: , upload: false) click to toggle source
# File lib/rundoc/code_command/website/screenshot.rb, line 3
def initialize(name: , upload: false)
  @driver = Rundoc::CodeCommand::Website::Driver.find(name)
  @upload = upload
end

Public Instance Methods

call(env = {}) click to toggle source
# File lib/rundoc/code_command/website/screenshot.rb, line 12
def call(env = {})
  puts "Taking screenshot: #{@driver.current_url}"
  filename = @driver.screenshot(upload: @upload)
  env[:replace] = "![Screenshot of #{@driver.current_url}](#{filename})"
  ""
end
to_md(env = {}) click to toggle source
# File lib/rundoc/code_command/website/screenshot.rb, line 8
def to_md(env = {})
  ""
end