Sha256: 1c5bfcaf8328345eff64a03e7bc28d28d0b20acf6a8e4feedaf08ea6e67dc8d4
Contents?: true
Size: 957 Bytes
Versions: 3
Compression:
Stored size: 957 Bytes
Contents
module Gatling class Image attr_accessor :file_name, :path, :image attr_reader :type def initialize image, file_name @file_name = file_name @image = image end def save type @path = path(type) FileUtils::mkdir_p(File.dirname(@path)) unless File.exists?(@path) @image.write @path @path end def exists? File.exists?(path) end def path type = :reference @path = File.join(Gatling::Configuration.path(type), @file_name) end end class ImageFromElement < Image def initialize element, file_name super(image, file_name) @image = Gatling::CaptureElement.new(element).capture end #TODO: make save a relevant subclass method end class ImageFromFile < Image def initialize file_name super(image, file_name) @image = Magick::Image.read(path).first end #TODO: make save a relevant subclass method end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gatling-1.1.2 | lib/gatling/image.rb |
gatling-1.1.1 | lib/gatling/image.rb |
gatling-1.1.0 | lib/gatling/image.rb |