Sha256: f1ea32676aa13a97694289b9f504dbe00c70b5b5cd924e7525c5daed9ff934cb
Contents?: true
Size: 599 Bytes
Versions: 18
Compression:
Stored size: 599 Bytes
Contents
class ScreenshotMaker attr_reader :basedir def initialize basedir @basedir = File.expand_path(basedir.to_s) end def make page, options page.save_screenshot(screenshot_path(options)) end def screenshot_path options "#{basedir}/#{screenshot_name(options)}" end def screenshot_name options filename = File.basename(options[:file_path]) line_number = options[:line_number] name = "screenshot-#{filename}" name += "-#{line_number}" if line_number "#{name}.png" end def screenshot_url options "file:///#{screenshot_path(options)}" end end
Version data entries
18 entries across 18 versions & 1 rubygems