ferrum 0.6 → 0.6.1

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: 4f657c088b22a9ff5809b6ecd0d7005cd0c2252645b262e76faee1b6e3af94c8
4
- data.tar.gz: d22842188425c753e0a0e113be52e0176e8a7e1a97211c44bf3016e90aa0d1d4
3
+ metadata.gz: 4f5179f765dbfb25cfbb1512958c5c4e8d2e8b486d48973bd2d2922389f74f8f
4
+ data.tar.gz: 47f2b8cc7afc75c06dffe27fae3e3a54558c86579c412d6806e9713e3282c0e8
5
5
  SHA512:
6
- metadata.gz: a519e80c6b1450ba85c555d4c5eb547ffb62f129e7873515ba2f5bad4726548289bcc3b4db95932873620e4b645f2f9b7f12c8bd0fdbe0ddada4f0faae080720
7
- data.tar.gz: 91a8f95433f9630dd0f2b36c42ea14bf28b49ee9504738c664399eeb7fc3d192bd26c14ae7de707dcaa8273ec65d7b1a8e9bcaeeff4287392a5e1b312ea03b0d
6
+ metadata.gz: 9566908dab8979128138801a7b105905e0198e4873b9c668e231078108a31cc6e7586ab4c4405c527908ffb9557d255bc9a02b6e878392946b2eb1d79f8cc0a0
7
+ data.tar.gz: 4b4fa5c411f0831a0fbd80ac880621e0459ff8dc976d828c1b88dfbf5f05023a096b2a6696269048416b7bdcef1f34f8d360a841e0798bb936277a96b4da4929
data/README.md CHANGED
@@ -17,6 +17,8 @@ this code inside in one form or another but the thing is you don't need capybara
17
17
  if you are going to crawl sites. You crawl, not test. Besides that clean
18
18
  lightweight API to browser is what Ruby was missing, so here it comes.
19
19
 
20
+ If you like this project, please consider to [become a backer](https://www.patreon.com/rferrum) on Patreon.
21
+
20
22
  ## Install
21
23
 
22
24
  There's no official Chrome or Chromium package for Linux don't install it this
@@ -37,6 +37,10 @@ module Ferrum
37
37
  @parent_id.nil?
38
38
  end
39
39
 
40
+ def execution_id?(execution_id)
41
+ @execution_id == execution_id
42
+ end
43
+
40
44
  def execution_id
41
45
  raise NoExecutionContextError unless @execution_id
42
46
  @execution_id
@@ -11,11 +11,9 @@ module Ferrum
11
11
  @frames.values
12
12
  end
13
13
 
14
- def frame_by(id: nil, execution_id: nil, name: nil)
14
+ def frame_by(id: nil, name: nil)
15
15
  if id
16
16
  @frames[id]
17
- elsif execution_id
18
- frames.find { |f| f.execution_id == execution_id }
19
17
  elsif name
20
18
  frames.find { |f| f.name == name }
21
19
  else
@@ -96,7 +94,7 @@ module Ferrum
96
94
 
97
95
  on("Runtime.executionContextDestroyed") do |params|
98
96
  execution_id = params["executionContextId"]
99
- frame = frame_by(execution_id: execution_id)
97
+ frame = frames.find { |f| f.execution_id?(execution_id) }
100
98
  frame.execution_id = nil
101
99
  end
102
100
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ferrum
4
- VERSION = "0.6"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ferrum
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Vorotilin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-29 00:00:00.000000000 Z
11
+ date: 2019-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-driver