looks_good 1.1.1 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 453e5498b4740e2fe1c415307921f1acaf410c7d6f6395ea531916249c30792a
4
- data.tar.gz: 3f08a7bb2ccb8d860072783bc7dc3fd96fa528a8826d8d1a2f2e401bdb94cb99
3
+ metadata.gz: c462a9ecb9fb7a30f241bb237e404cf54cb6ad44f657c30ed6be09a68e81d45e
4
+ data.tar.gz: '0925e527d0e0442f306f496f025f7860410de8cb3bdf4380a2025f864dded2d3'
5
5
  SHA512:
6
- metadata.gz: f9b731e277ff3015ef89693bb4595e7c4d1346bd244615e989e57ea4395a055d73239ec16cd88721052d8154b5edc38720f5ecff18a64d055dbf2408d8f92d9d
7
- data.tar.gz: 58cd545954d8d637f5577184f2d2c39c57716c48ecf86237df7c86ba96b86b70a52d29a9978ab390714db1182cc1b75fb68ab5b3a8829ebdb4b60e22e3c68954
6
+ metadata.gz: f0f88aacde52afd6de5ad16fce846a3ad108616731d4aecd8c1afa40b54aa4b398a1f9a7356b58a9ec1da999a9a4d07f6f2152855b4fe043590d5486d28c59da
7
+ data.tar.gz: e4c27848c34ff0f28d8547f07a4be93a4a901f62d0b1d50731adc71eb6d43c0b7a668b02f9595f91f0c2d718376809070659fe8506553e24cd4569aced81b3cc
data/README.md CHANGED
@@ -63,6 +63,7 @@ you can override any of the defaults with a config block.
63
63
  c.sleep_between_tries = 0.5
64
64
  c.browser_folders = false
65
65
  c.scale_amount = 0.5
66
+ c.disable_scling = true
66
67
  c.fuzz = "10%"
67
68
  end
68
69
 
@@ -87,7 +88,11 @@ Also created are subfolders:
87
88
  - allows pixels to not need to match exactly. a string percentage value, provided to imagemagick as fuzz value for comparison. default is "10%"
88
89
 
89
90
  #### scale_amount
90
- - Retina mac screenshots are 2x actual size, so this scales them to be 1:1. default is 0.5, set to 1 to disable.
91
+ - Retina mac screenshots are 2x actual size, so this scales them to be 1:1. default is 0.5.
92
+
93
+ #### disable_scaling
94
+ set to true to disable the scaling behavior
95
+
91
96
 
92
97
  #### Sleep_between_tries
93
98
  - sets the sleep time (in seconds) between match tries (requires max_no_tries > 1). Defaults to 0.5
@@ -39,7 +39,8 @@ module LooksGood
39
39
  end
40
40
 
41
41
  def self.crop_element(image, element_to_crop, position)
42
- cropped_element = image.scale!(LooksGood::Configuration.scale_amount).crop!(position[:x], position[:y], position[:width], position[:height])
42
+ image.scale!(LooksGood::Configuration.scale_amount) unless LooksGood::Configuration.disable_scaling
43
+ cropped_element = image.crop!(position[:x], position[:y], position[:width], position[:height])
43
44
  end
44
45
 
45
46
  end
@@ -5,7 +5,8 @@ module LooksGood
5
5
 
6
6
  class << self
7
7
 
8
- attr_accessor :fuzz, :reference_image_path, :max_no_tries, :sleep_between_tries, :browser_folders, :default_within
8
+ attr_accessor :fuzz, :reference_image_path, :max_no_tries, :sleep_between_tries,
9
+ :browser_folders, :default_within, :scale_amount, :disable_scaling
9
10
 
10
11
  attr_reader :paths
11
12
 
@@ -27,6 +28,10 @@ module LooksGood
27
28
  @max_no_tries ||= 2
28
29
  end
29
30
 
31
+ def disable_scaling
32
+ @disable_scaling ||= false
33
+ end
34
+
30
35
  def fuzz
31
36
  @fuzz ||= "10%"
32
37
  end
@@ -1,5 +1,5 @@
1
1
  require 'looks_good'
2
-
2
+ require 'rspec'
3
3
  RSpec::Matchers.define :look_like do |expected, within: LooksGood::Configuration.default_within|
4
4
  result = nil
5
5
  match do |actual|
@@ -1,3 +1,4 @@
1
+ require 'rspec'
1
2
  RSpec.configure do |config|
2
3
  config.before(:suite) do
3
4
  LooksGood.cleanup
@@ -1,3 +1,3 @@
1
1
  module LooksGood
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: looks_good
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Jennings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-12 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick