Sha256: 61503709bf04741b302e630c7e4e70eea33d375e8018c933b8b846a462c95a46

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require "gnawrnip/version"
require 'gnawrnip/rmagick/photographer'
require 'gnawrnip/ext/capybara/session'
require 'gnawrnip/animation'
require 'gnawrnip/screenshot'
require 'gnawrnip/step_screenshot'
require 'gnawrnip/rspec'

module Gnawrnip
  class << self
    attr_accessor :photographer_driver
    attr_accessor :frame_interval
    attr_accessor :frame_size

    def configure
      yield self
    end

    def ready!
      photographer # Try to load driver library.
    end

    def photographer
      @photographer ||= case photographer_driver
                        when :rmagick
                          require 'gnawrnip/rmagick/photographer'
                          @photographer = RMagick::Photographer.new
                        else # :js
                          require 'gnawrnip/js/photographer'
                          @photographer = JS::Photographer.new
                        end
    end
  end
end

Gnawrnip.configure do |c|
  c.photographer_driver = :js
  c.frame_interval = 1000
  c.frame_size = nil
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gnawrnip-0.1.2 lib/gnawrnip.rb
gnawrnip-0.1.1 lib/gnawrnip.rb