Sha256: fbe10495917299dbf68ae8eb2686e1228c22fbd645413a7433939027a6ec7cb6

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'rmagick'
require 'fileutils'
require 'yaml'
require 'pry'
require_relative "nakal/version"
require_relative 'nakal/base_screen'
require_relative 'nakal/android/screen'
require_relative 'nakal/ios/screen'
require_relative 'nakal/dsl'

module Nakal

  class<<self
    attr_accessor :device_name, :directory, :platform, :image_location, :default_crop_params
    attr_accessor :diff_screens, :embed_screenshot, :timeout, :image_relative_dir

    def configure
      yield self
    end

    def create_image_dir image_relative_dir
      @image_relative_dir = image_relative_dir
      @image_location = "#{@directory}/#{@device_name}/#{image_relative_dir}"
      FileUtils.mkdir_p @image_location unless File.directory?(@image_location)
    end

    def current_platform
      Nakal.const_get Nakal.platform.capitalize
    end

  end
end

Nakal.configure do |config|
  config.device_name = "default_device"
  config.directory = "baseline_images"
  config.default_crop_params = (YAML.load(File.open './config/nakal.yml') rescue {})
  config.embed_screenshot = false
  config.diff_screens = []
  config.timeout = 30
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nakal-1.0.0 lib/nakal.rb
nakal-0.1.2 lib/nakal.rb