nakal 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44b784455b49ceb374d87090fc8342463f73d4ca
4
- data.tar.gz: 52e46489fd1bfa56e28fa546b469172ab871b12d
3
+ metadata.gz: 1308e125b0ff692265dfb34cee188b56593f6795
4
+ data.tar.gz: 066e33d390361816d21dbddb575c85d67ab4f549
5
5
  SHA512:
6
- metadata.gz: 78078f70eaf4140b5d3c6d946d9fac147504a5deac081e52729de972a6dda2b28c12d70c5fe0d5033d57b4abf6fa75e5d1492bb3463b6cb20a821eaa1e984d06
7
- data.tar.gz: bf9e8fb749d24964d37171619ccd4c5892102dacc3075162abd6e9986fdc192dfbbc641a7265906352a814b96300b82b63f2525fe78c1e65920823af02443b38
6
+ metadata.gz: 2d49e3e455cc5d16eed121a559a34ba533ca75a564493227819a52519b3fb473590c8dd788a66c16b9596a5a8fac1b40e21e95e858a886de2eae0426f406c3fd
7
+ data.tar.gz: 0962fc58129af517b05e0c8a35bc3309f6e3c184afece7dc2ce3c1905a80e9450e706913556f813386a0681665428593654b32496dd4a790f694bda1c738443e
@@ -12,7 +12,7 @@ module Nakal
12
12
 
13
13
  class<<self
14
14
  attr_accessor :device_name, :directory, :platform, :image_location, :default_crop_params
15
- attr_accessor :diff_screens, :embed_screenshot, :timeout, :image_relative_dir, :fuzz
15
+ attr_accessor :diff_screens, :embed_screenshot, :timeout, :image_relative_dir, :fuzz, :config_location
16
16
 
17
17
  def configure
18
18
  yield self
@@ -24,6 +24,15 @@ module Nakal
24
24
  FileUtils.mkdir_p @image_location unless File.directory?(@image_location)
25
25
  end
26
26
 
27
+ def load_config
28
+ @default_crop_params ||= YAML.load(File.open Nakal.config_location)
29
+ end
30
+
31
+ def set relative_location
32
+ create_image_dir relative_location
33
+ load_config
34
+ end
35
+
27
36
  def current_platform
28
37
  Nakal.const_get Nakal.platform.capitalize
29
38
  end
@@ -34,7 +43,7 @@ end
34
43
  Nakal.configure do |config|
35
44
  config.device_name = "default_device"
36
45
  config.directory = "baseline_images"
37
- config.default_crop_params = (YAML.load(File.open './config/nakal.yml') rescue {})
46
+ config.config_location = "./config/nakal.yml"
38
47
  config.embed_screenshot = false
39
48
  config.diff_screens = []
40
49
  config.timeout = 30
@@ -39,7 +39,7 @@ module Nakal
39
39
 
40
40
  def nakal_execute relative_location, params = {:delay => nil, :replace_baseline => false, :acceptable_diff => 0.0}
41
41
  return if ENV['NAKAL_MODE'].nil?
42
- Nakal.create_image_dir File.dirname(relative_location)
42
+ Nakal.set File.dirname(relative_location)
43
43
  screen_name = File.basename(relative_location)
44
44
  sleep params[:delay] unless params[:delay].nil?
45
45
  capture_screen(screen_name) if (ENV['NAKAL_MODE'] == "build") || (params[:replace_baseline] == true)
@@ -1,3 +1,3 @@
1
1
  module Nakal
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajdeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-30 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.4.8
121
+ rubygems_version: 2.5.1
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Automated visual regression testing of android and ios apps with appium ,