watir-screenshot-stitch 0.6.5 → 0.6.6

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: f07f47edb1870dd100e4a9d57aa967533aee97f2e19f5ba14afcb80dfb5c19b6
4
- data.tar.gz: 154b57ebd2422ed32b6cd831fb78bdd3262b20f30effc74e529800ba7ab9137e
3
+ metadata.gz: fd6ae2c56651dc8041dffd92f6c9b4477e9c81d11b17b2aac058904ab58f1f8e
4
+ data.tar.gz: f277df5ee5f812fa4de1f7a5d1a902fb4ee52d73ccd8a8186c203914d4483d73
5
5
  SHA512:
6
- metadata.gz: 9413b0fb0799c887fa5cd5fa74536ffed83cced52a9e8ce2ecb62d576df5828a18d4a7bc876e66f6722f97e6f384c10e3eaf8cba24a5a1b97bce011ad68b05eb
7
- data.tar.gz: 8cfa1e3c257a0c37b60c6f4c3211b9f1c5d69cc40fe0ded93907ef9bb0c5a73ddedf6e4b5f161531f70e7512cb72712c3237e618d0f7ea6fe348e77924c1ee44
6
+ metadata.gz: 100a998821100f775154a1429dd73daf6dd630492b332393ad55efb0e134c386e24f023759f655108b85423c79045739339737b6e447dd7bf0ce692e8deb0316
7
+ data.tar.gz: 3b3036501c185abc589046eefcaccf2931a8eda494697366831c51b15bf41221185f4d159e5a248e3f276c2a821962f5dea54339f946d008404cb4575ecf5a9b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- watir-screenshot-stitch (0.6.4)
4
+ watir-screenshot-stitch (0.6.5)
5
5
  binding_of_caller (~> 0.7)
6
6
  mini_magick (~> 4.0)
7
7
  os (~> 1.0)
@@ -12,11 +12,11 @@ GEM
12
12
  specs:
13
13
  binding_of_caller (0.8.0)
14
14
  debug_inspector (>= 0.0.1)
15
- childprocess (0.8.0)
15
+ childprocess (0.9.0)
16
16
  ffi (~> 1.0, >= 1.0.11)
17
17
  debug_inspector (0.0.3)
18
18
  diff-lcs (1.3)
19
- ffi (1.9.18)
19
+ ffi (1.9.23)
20
20
  mini_magick (4.8.0)
21
21
  os (1.0.0)
22
22
  rake (10.5.0)
@@ -34,10 +34,10 @@ GEM
34
34
  rspec-support (~> 3.7.0)
35
35
  rspec-support (3.7.0)
36
36
  rubyzip (1.2.1)
37
- selenium-webdriver (3.8.0)
37
+ selenium-webdriver (3.12.0)
38
38
  childprocess (~> 0.5)
39
- rubyzip (~> 1.0)
40
- watir (6.10.2)
39
+ rubyzip (~> 1.2)
40
+ watir (6.11.0)
41
41
  selenium-webdriver (~> 3.4, >= 3.4.1)
42
42
 
43
43
  PLATFORMS
@@ -50,4 +50,4 @@ DEPENDENCIES
50
50
  watir-screenshot-stitch!
51
51
 
52
52
  BUNDLED WITH
53
- 1.16.1
53
+ 1.16.2
data/README.md CHANGED
@@ -29,6 +29,19 @@ parts of this stack, you're a better Googler than me.
29
29
 
30
30
  ## Usage
31
31
 
32
+ ### WARNING: Browser passing will soon no longer be required
33
+
34
+ As of watir-screenshot-stitch version 0.7.0, the Watir::Screenshot
35
+ class will have access to the browser, and it will not need to be
36
+ passed to the public methods. `save_stitch(path, browser, opts)`
37
+ will become `save_stitch(path, opts)`, and `base64_canvas(browser)`
38
+ will become `base64_canvas` and existing implementations will
39
+ break.
40
+
41
+ To suppress warnings in the meantime, upgrade to Watir 6.12
42
+ and pass `nil` in place of the `browser` for #save_stitch and
43
+ use `base64_canvas` with no parameters.
44
+
32
45
  ### Stitching
33
46
 
34
47
  watir-screenshot-stitch can be used with a typical Watir script. This
@@ -62,11 +75,15 @@ b.screenshot.base64_canvas(b)
62
75
 
63
76
  will return a base64 encoded image blob of the given site.
64
77
 
65
- ### macOS Retina
78
+ ### Doubling resolution calculations, including macOS Retina
66
79
 
67
- watir-screenshot-stitch assumes any user running macOS is displaying at
68
- 'Retina' resolution, therefore multiplies all screen resolutions by 2.
69
- Any other operating system will not trigger this multiplication.
80
+ watir-screenshot-stitch uses CSS selectors to determine whether a
81
+ resulting screenshot's dimensions will be double
82
+ the page dimensions when a screenshot is captured,
83
+ as is the case for macOS 'Retina', and relies on this
84
+ logic to determine how to stitch together images.
85
+ This means that moving the browser window while it is be driven by
86
+ Watir can cause unpredictable results.
70
87
 
71
88
  ### Passing the browser?
72
89
 
@@ -102,4 +119,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
102
119
 
103
120
  ## Code of Conduct
104
121
 
105
- Everyone interacting in the Watir::Screenshot::Stitch project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/watir-screenshot-stitch/blob/master/CODE_OF_CONDUCT.md).
122
+ Everyone interacting in the Watir::Screenshot::Stitch project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/samnissen/watir-screenshot-stitch/blob/master/CODE_OF_CONDUCT.md).
@@ -21,14 +21,15 @@ module Watir
21
21
  # browser.screenshot.save_stitch("path/abc.png", browser, opts)
22
22
  #
23
23
  # @param [String] path
24
- # @param [Watir::Browser] browser
24
+ # @deprecated
25
+ # @param [Watir::Browser] browser
25
26
  # @param [Hash] opts
26
27
  #
27
28
 
28
- def save_stitch(path, browser, opts = {})
29
+ def save_stitch(path, browser = @browser, opts = {})
29
30
  @options = opts
30
31
  @path = path
31
- @browser = browser
32
+ deprecate_browser(browser, (__LINE__-3))
32
33
  calculate_dimensions
33
34
 
34
35
  return self.save(@path) if (one_shot? || bug_shot?)
@@ -48,13 +49,14 @@ module Watir
48
49
  # browser.screenshot.base64_canvas(browser)
49
50
  # #=> '7HWJ43tZDscPleeUuPW6HhN3x+z7vU/lufmH0qNTtTum94IBWMT46evImci1vnFGT'
50
51
  #
51
- # @param [Watir::Browser] browser
52
+ # @deprecated
53
+ # @param [Watir::Browser] browser
52
54
  #
53
55
  # @return [String]
54
56
  #
55
57
 
56
- def base64_canvas(browser)
57
- @browser = browser
58
+ def base64_canvas(browser = @browser)
59
+ deprecate_browser(browser, (__LINE__-1))
58
60
  output = nil
59
61
 
60
62
  return self.base64 if one_shot? || bug_shot?
@@ -72,6 +74,12 @@ module Watir
72
74
  end
73
75
 
74
76
  private
77
+ def deprecate_browser(browser, line)
78
+ return unless browser
79
+ warn "[DEPRECATION] WatirScreenshotStitch: Passing the browser is deprecated and will no longer work in version 0.7.0 /lib/watir-screenshot-stitch.rb:#{line}"
80
+ @browser = browser
81
+ end
82
+
75
83
  def one_shot?
76
84
  calculate_dimensions unless @loops && @remainder
77
85
  ( (@loops == 1) && (@remainder == 0) )
@@ -1,4 +1,4 @@
1
1
  module WatirScreenshotStitch
2
2
  NAME = 'watir-screenshot-stitch'
3
- VERSION = "0.6.5"
3
+ VERSION = "0.6.6"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-screenshot-stitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Nissen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-23 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.7.4
154
+ rubygems_version: 2.7.7
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Extends Watir to take stitched-together screenshots of full web pages.