andrewhao-chrome_remote 0.2.0 → 0.2.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: 6616c7823cff2bdf02b5e03e4744b1262701cf5c962c1b9a69851b307789aa9c
4
- data.tar.gz: 32601cc6180df55a7df5191c18522ac1c5186eea77de01a913925c7880c32c75
3
+ metadata.gz: b59d1acd253018419f7fccd029242d78f64489df9a3f40ac24202ef2d29e18ed
4
+ data.tar.gz: 1e87cfd0ac9470bda7f06db4f4a90bb5a6c19340893892b36aea1842d51a056c
5
5
  SHA512:
6
- metadata.gz: 54bb5570a24d5983df28f88aa6759c7256b81fdb1334fda253c83b4901c4ef673bca66cbe9071827834f33974d6a8d97e22c040942ed7d8fcbbecaeaceda3ee3
7
- data.tar.gz: cf167c78c14c67a24f4dbf3cfca44a7a16df32156874a814277ecedd634de5bf3f4cce47324e3fefedb1e582db274151e96581d59bcfa034c25bde286af97253
6
+ metadata.gz: 1a73161104a74ee85ec8aca043b1d9817c07961c497ed92544e210726b8767d773f56ed9f69a215245692c8c717e5818dfe8a57909aa74b3e369b94d9006b819
7
+ data.tar.gz: f4018cfc43ae09167769be742d272a2d16261d1426a2590361bf2b8088b1e172153346414102146ebd26f704361b936eeda6351b3c807dac1858964808b414af
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ *.gem
@@ -31,13 +31,15 @@ module ChromeRemote
31
31
  read_until { false }
32
32
  end
33
33
 
34
- def wait_for(event_name=nil)
35
- if event_name
36
- msg = read_until { |msg| msg["method"] == event_name }
37
- elsif block_given?
38
- msg = read_until { |msg| yield(msg["method"], msg["params"]) }
34
+ def wait_for(event_name=nil, timeout: nil)
35
+ Timeout::timeout(timeout) do
36
+ if event_name
37
+ msg = read_until { |msg| msg["method"] == event_name }
38
+ elsif block_given?
39
+ msg = read_until { |msg| yield(msg["method"], msg["params"]) }
40
+ end
41
+ Hashie::Mash.new(msg["params"])
39
42
  end
40
- Hashie::Mash.new(msg["params"])
41
43
  end
42
44
 
43
45
  private
@@ -1,3 +1,3 @@
1
1
  module ChromeRemote
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andrewhao-chrome_remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luismi Cavalle