blinkr 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blinkr/config.rb +16 -5
- data/lib/blinkr/engine.rb +1 -1
- data/lib/blinkr/extensions/links.rb +3 -3
- data/lib/blinkr/phantomjs_wrapper.rb +5 -1
- data/lib/blinkr/slimer_js_wrapper.rb +5 -0
- data/lib/blinkr/typhoeus_wrapper.rb +3 -1
- data/lib/blinkr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2657c0ca08b00bf7cf9382dbe26798919ec9c72
|
4
|
+
data.tar.gz: 849ccd9b225ee72eb254d33de181e368fefae007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8773b0022dc4c69561a4c744d95fef17e76f548d77730f75dea2630d7832b4d7de22d30ac7cafd55bd562a246cfd224522b412206fbfea53b47a858cd649809d
|
7
|
+
data.tar.gz: 3a9909351f7f27451c7e29d6b5fc176bedf2b76b7ba7a121d754801a019b12720f9cfe27fc64dbe3555ce3d6ce25690d96c872744601ef81f80d11bb18b9ca31
|
data/lib/blinkr/config.rb
CHANGED
@@ -38,13 +38,24 @@ module Blinkr
|
|
38
38
|
r
|
39
39
|
end
|
40
40
|
|
41
|
-
def ignored?
|
42
|
-
|
41
|
+
def ignored? error
|
42
|
+
url = error.url
|
43
|
+
code = error.code
|
44
|
+
message = error.message
|
45
|
+
snippet = error.snippet
|
43
46
|
|
44
47
|
ignores.any? do |ignore|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
+
return true if ignore['url'].is_a?(Regexp) && url && ignore['url'] =~ url
|
49
|
+
return true if ignore['url'] == url
|
50
|
+
|
51
|
+
return true if ignore['code'].is_a?(Regexp) && code && ignore['code'] == code
|
52
|
+
return true if ignore['code'] == code
|
53
|
+
|
54
|
+
return true if ignore['message'].is_a?(Regexp) && message && ignore['message'] =~ message
|
55
|
+
return true if ignore['message'] == message
|
56
|
+
|
57
|
+
return true if ignore['snippet'].is_a?(Regexp) && snippet && ignore['snippet'] =~ snippet
|
58
|
+
return true if ignore['snippet'] == snippet
|
48
59
|
false
|
49
60
|
end
|
50
61
|
end
|
data/lib/blinkr/engine.rb
CHANGED
@@ -63,13 +63,13 @@ module Blinkr
|
|
63
63
|
end
|
64
64
|
@links.each do |url, metadata|
|
65
65
|
# if link start_with? @config.base_url check to see if it's in the sitemap.xml
|
66
|
-
browser.process(url, @config.max_retrys, :method => :get, :followlocation => true, :timeout =>
|
66
|
+
browser.process(url, @config.max_retrys, :method => :get, :followlocation => true, :timeout => 60,
|
67
67
|
:cookiefile => '_tmp/cookies', :cookiejar => '_tmp/cookies',
|
68
|
-
|
68
|
+
:connecttimeout => 30, :maxredirs => 3) do |resp|
|
69
69
|
puts "Loaded #{url} via #{browser.name} #{'(cached)' if resp.cached?}" if @config.verbose
|
70
70
|
|
71
71
|
resp_code = resp.code.to_i
|
72
|
-
if
|
72
|
+
if ((resp_code > 300 && resp_code < 400) && @config.warning_on_300s) || resp_code > 400
|
73
73
|
response = resp
|
74
74
|
|
75
75
|
detail = nil
|
@@ -35,6 +35,10 @@ module Blinkr
|
|
35
35
|
'phantomjs'
|
36
36
|
end
|
37
37
|
|
38
|
+
def command
|
39
|
+
'phantomjs'
|
40
|
+
end
|
41
|
+
|
38
42
|
private
|
39
43
|
|
40
44
|
def _process url, limit, max, opts = {}, &block
|
@@ -47,7 +51,7 @@ module Blinkr
|
|
47
51
|
return block.call response, @cache.get("#{url}-resourceErrors"), @cache.get("#{url}-javascriptErrors")
|
48
52
|
end
|
49
53
|
|
50
|
-
output, status = Open3.capture2("#{
|
54
|
+
output, status = Open3.capture2("#{command} #{SNAP_JS} #{url} #{@config.viewport}")
|
51
55
|
if status == 0
|
52
56
|
json = JSON.load(output)
|
53
57
|
response = Typhoeus::Response.new(:code => 200, :body => json['content'], :effective_url => json['url'],
|
@@ -77,7 +77,9 @@ module Blinkr
|
|
77
77
|
unless @config.skipped? url
|
78
78
|
req = Typhoeus::Request.new(
|
79
79
|
url,
|
80
|
-
opts.merge(:followlocation => true
|
80
|
+
opts.merge(:followlocation => true, :timeout => 60,
|
81
|
+
:cookiefile => '_tmp/cookies', :cookiejar => '_tmp/cookies',
|
82
|
+
:connecttimeout => 30, :maxredirs => 3)
|
81
83
|
)
|
82
84
|
req.on_complete do |resp|
|
83
85
|
if retry? resp
|
data/lib/blinkr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blinkr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Muir
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|