postdoc 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/postdoc.rb +13 -3
  3. metadata +14 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fd07fd7a356f5e41dd00199937c8824010562d255d6539e59398e3fb55c0f79
4
- data.tar.gz: e89f06d78b8bd657ccfd52a2b079eea7035e1b77fda5380e6bc6f7a1f315e254
3
+ metadata.gz: 529772412289f1fe24ffeedd9644f2f8799ee955c3dea07f256a33e23ca1bc51
4
+ data.tar.gz: 2b27cdf8389e6c096c1dc64f3005396542c7808e04449f79d81f1f62990b1f0a
5
5
  SHA512:
6
- metadata.gz: '088597cc28cad883de3f539aa2e6e373285fa55b17cad6a17e619febce77d747c9174e0f2c6b1cca1d3583140b42f32e8b87c86bfdd3ae15361a9e36c6d3d945'
7
- data.tar.gz: 84d58a0ea2eeacbef730c0ac47d356125f934fe1e5cfe013cffcf87b5224e5af517b229e60f305f3dbb42e9d5ce753978ff615995a871de91cceebf2d056af4f
6
+ metadata.gz: 948c6386bc64c6ee7d5d9423a905dfec09dbbc2a5ed80e8032817929f13e5b682ded267a4751aa3fe66cd5d38f83b66abf4ee0989f1b2a4bf2e3fb0bdc4ea9b4
7
+ data.tar.gz: ce0193c8374d7c6fb44f8196829531156b79b4684ace11d172224bc1bdcf87f089a82757344e00edad9d377d76e037d83215d482247ce30e0b115af496d9d75b
@@ -18,9 +18,19 @@ module Postdoc
18
18
  random_port = 1024 + Random.rand(65_535 - 1024)
19
19
  pid = Process.spawn "chrome --remote-debugging-port=#{random_port} --headless"
20
20
  end
21
-
22
- # FIXME
23
- sleep 1
21
+
22
+ success = false
23
+ 10.times do
24
+ begin
25
+ TCPSocket.new('localhost', random_port)
26
+ success = true
27
+ break
28
+ rescue
29
+ end
30
+ sleep 1
31
+ end
32
+
33
+ return unless success
24
34
 
25
35
  begin
26
36
  chrome = options[:client].nil? ? ChromeRemote.client(port: random_port) : options[:client]
metadata CHANGED
@@ -1,49 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Groeneveld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-21 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: chrome_remote
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '6.1'
19
+ version: 0.2.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 4.0.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '6.1'
26
+ version: 0.2.0
33
27
  - !ruby/object:Gem::Dependency
34
- name: chrome_remote
28
+ name: rails
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - ">="
38
32
  - !ruby/object:Gem::Version
39
- version: 0.2.0
33
+ version: 4.0.0
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '6.1'
40
37
  type: :runtime
41
38
  prerelease: false
42
39
  version_requirements: !ruby/object:Gem::Requirement
43
40
  requirements:
44
41
  - - ">="
45
42
  - !ruby/object:Gem::Version
46
- version: 0.2.0
43
+ version: 4.0.0
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '6.1'
47
47
  description: Description of Postdoc.
48
48
  email:
49
49
  - frank@ivaldi.nl