perus 0.1.22 → 0.1.23

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
  SHA1:
3
- metadata.gz: e622a4678cfa0b65a7fb77ae39b45ff4489140ac
4
- data.tar.gz: d78f1a46700e24f2377f25459fc0488f33babdd5
3
+ metadata.gz: b07d8761ba75a90905014a0b9b9c9e61e82d83bf
4
+ data.tar.gz: 24b59fd85398aaffa2c82a7abda42483980e052b
5
5
  SHA512:
6
- metadata.gz: a50dce97f9d25871402b771e6528a5144a4fcfdf4da5b4f6bcef636655ce8fd7f278395678aad1ddc123dc43bed4837a317169d00d9d9872395bc69aceb01d28
7
- data.tar.gz: 695b701da0d7100bc5cf1ef250c674815e279f6a4d6dc1945a5326d3621fd03357bef7936a7a54d90aba7b07135e4d36dc9743418c9dda0edeea34cf5a3c07d2
6
+ metadata.gz: 42fb2b6b1c0e01c0737a6aeda7029d03b43f5c178a608255ab586b624f60c2e2a0f44cf4da7c9a0e601c4e717c01cc6c0c93e29748d667fc834033926f3c6897
7
+ data.tar.gz: 073d7bbd5a344181bd471e28a381c854094010b74895eb7f36adaeba95c629fc8e7c83252785e330ef1edd9bcb3f7fd418ab36b3b611a07cda14961ab5d792fa
@@ -16,9 +16,18 @@ module Perus::Pinger
16
16
 
17
17
  def execute(commands, &message_callback)
18
18
  # discover the first page shown in chrome
19
- pages = JSON.parse(RestClient.get("http://#{options.host}:#{options.port}/json"))
20
- pages.reject! {|page| page['url'].include?('chrome-extension')}
21
- @page = pages.first
19
+ tries = 0
20
+ @page = nil
21
+ begin
22
+ pages = JSON.parse(RestClient.get("http://#{options.host}:#{options.port}/json"))
23
+ pages.reject! {|page| page['url'].include?('chrome-extension')}
24
+ @page = pages.first
25
+ rescue Errno::ECONNREFUSED, Errno::ECONNRESET => e
26
+ tries += 1
27
+ sleep 3
28
+ retry if tries < 4
29
+ return
30
+ end
22
31
 
23
32
  EM.run do
24
33
  @ws = Faye::WebSocket::Client.new(@page['webSocketDebuggerUrl'])
@@ -23,6 +23,8 @@ module Perus::Pinger
23
23
  end
24
24
  end
25
25
 
26
+ return {} if @page.nil?
27
+
26
28
  {
27
29
  chrome_warnings: warning_count,
28
30
  chrome_errors: error_count,
@@ -1,3 +1,3 @@
1
1
  module Perus
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Cannings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -333,8 +333,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
333
  version: '0'
334
334
  requirements: []
335
335
  rubyforge_project:
336
- rubygems_version: 2.4.5
336
+ rubygems_version: 2.4.6
337
337
  signing_key:
338
338
  specification_version: 4
339
339
  summary: Simple system overview server
340
340
  test_files: []
341
+ has_rdoc: