ndd-url_checker 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -1
- data/Gemfile.lock +57 -44
- data/README.md +5 -2
- data/VERSION +1 -1
- data/lib/ndd/url_checker.rb +2 -0
- data/lib/ndd/url_checker/blocking_url_checker.rb +7 -4
- data/lib/ndd/url_checker/forked_url_checker.rb +4 -2
- data/lib/ndd/url_checker/reporting_url_checker.csv.erb +2 -2
- data/lib/ndd/url_checker/reporting_url_checker.html.erb +171 -80
- data/lib/ndd/url_checker/reporting_url_checker.json.erb +16 -9
- data/lib/ndd/url_checker/reporting_url_checker.rb +22 -11
- data/lib/ndd/url_checker/status.rb +1 -1
- data/lib/ndd/url_checker/status_decorator.rb +64 -0
- data/ndd-url_checker.gemspec +6 -4
- data/spec/ndd/url_checker/abstract_url_checker_spec.rb +1 -1
- data/spec/ndd/url_checker/blocking_url_checker_spec.rb +1 -1
- data/spec/ndd/url_checker/forked_url_checker_spec.rb +1 -1
- data/spec/ndd/url_checker/parallel_url_checker_spec.rb +1 -1
- data/spec/ndd/url_checker/reporting_url_checker/custom.txt.erb +2 -2
- data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.csv +5 -3
- data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.html +227 -92
- data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.json +29 -10
- data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.txt +12 -2
- data/spec/ndd/url_checker/reporting_url_checker/single_url.csv +1 -1
- data/spec/ndd/url_checker/reporting_url_checker/single_url.html +163 -78
- data/spec/ndd/url_checker/reporting_url_checker/single_url.json +14 -7
- data/spec/ndd/url_checker/reporting_url_checker_spec.rb +29 -12
- data/spec/ndd/url_checker/status_decorator_spec.rb +208 -0
- data/spec/ndd/url_checker/status_spec.rb +10 -10
- data/spec/ndd/url_checker/threaded_url_checker_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -3
- data/spec/support/multiple_url_checker_spec.rb +4 -4
- data/spec/support/single_url_checker_spec.rb +74 -21
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e878e5f4aff0bed140d52f9e1c888d9c951fc95
|
4
|
+
data.tar.gz: 1e5754bb7e356951ab4798083eada1c2b227a2a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e93630400c83f45833701355144aee71a907b78852bc2dde095efdc17598e621de1d19d5ffbf8e57cef66f1df289b4674e00e95ab155d7e79874cd8e585edd4
|
7
|
+
data.tar.gz: 2c7228f881743e6f8adc6bbd5f2908f1e0d8da0d05c69ffa9d000952c7618b89841e91740d52ffa436af64f39322b6e008250e67604ac6c9a11e28cefca2ead9
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.2.2
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
4
|
+
addressable (2.3.8)
|
5
5
|
builder (3.2.2)
|
6
6
|
celluloid (0.16.0)
|
7
7
|
timers (~> 4.0.0)
|
8
|
-
childprocess (0.5.
|
8
|
+
childprocess (0.5.6)
|
9
9
|
ffi (~> 1.0, >= 1.0.11)
|
10
10
|
cod (0.6.0)
|
11
|
-
codeclimate-test-reporter (0.4.
|
11
|
+
codeclimate-test-reporter (0.4.7)
|
12
12
|
simplecov (>= 0.7.1, < 1.0.0)
|
13
13
|
coderay (1.1.0)
|
14
14
|
crack (0.4.2)
|
@@ -17,12 +17,12 @@ GEM
|
|
17
17
|
thread_safe (~> 0.3, >= 0.3.1)
|
18
18
|
diff-lcs (1.2.5)
|
19
19
|
docile (1.1.5)
|
20
|
-
faraday (0.9.
|
20
|
+
faraday (0.9.1)
|
21
21
|
multipart-post (>= 1.2, < 3)
|
22
|
-
ffi (1.9.
|
22
|
+
ffi (1.9.8)
|
23
23
|
formatador (0.2.5)
|
24
|
-
git (1.2.
|
25
|
-
github_api (0.12.
|
24
|
+
git (1.2.9.1)
|
25
|
+
github_api (0.12.3)
|
26
26
|
addressable (~> 2.3)
|
27
27
|
descendants_tracker (~> 0.0.4)
|
28
28
|
faraday (~> 0.8, < 0.10)
|
@@ -30,26 +30,31 @@ GEM
|
|
30
30
|
multi_json (>= 1.7.5, < 2.0)
|
31
31
|
nokogiri (~> 1.6.3)
|
32
32
|
oauth2
|
33
|
-
guard (2.
|
33
|
+
guard (2.12.6)
|
34
34
|
formatador (>= 0.2.4)
|
35
35
|
listen (~> 2.7)
|
36
36
|
lumberjack (~> 1.0)
|
37
|
+
nenv (~> 0.1)
|
38
|
+
notiffany (~> 0.0)
|
37
39
|
pry (>= 0.9.12)
|
40
|
+
shellany (~> 0.0)
|
38
41
|
thor (>= 0.18.1)
|
39
|
-
guard-bundler (2.
|
42
|
+
guard-bundler (2.1.0)
|
40
43
|
bundler (~> 1.0)
|
41
44
|
guard (~> 2.2)
|
42
|
-
|
43
|
-
guard-
|
45
|
+
guard-compat (~> 1.1)
|
46
|
+
guard-compat (1.2.1)
|
47
|
+
guard-rspec (4.5.2)
|
44
48
|
guard (~> 2.1)
|
45
|
-
guard-compat (~>
|
49
|
+
guard-compat (~> 1.1)
|
46
50
|
rspec (>= 2.99.0, < 4.0)
|
47
|
-
guard-spork (2.0
|
51
|
+
guard-spork (2.1.0)
|
48
52
|
childprocess (>= 0.2.3)
|
49
|
-
guard (~> 2.
|
53
|
+
guard (~> 2.0)
|
54
|
+
guard-compat (~> 1.0)
|
50
55
|
spork (>= 0.8.4)
|
51
|
-
hashie (3.
|
52
|
-
highline (1.
|
56
|
+
hashie (3.4.2)
|
57
|
+
highline (1.7.2)
|
53
58
|
hitimes (1.2.2)
|
54
59
|
jeweler (2.0.1)
|
55
60
|
builder
|
@@ -60,12 +65,12 @@ GEM
|
|
60
65
|
nokogiri (>= 1.5.10)
|
61
66
|
rake
|
62
67
|
rdoc
|
63
|
-
json (1.8.
|
64
|
-
jwt (1.
|
65
|
-
libnotify (0.
|
68
|
+
json (1.8.3)
|
69
|
+
jwt (1.5.0)
|
70
|
+
libnotify (0.9.1)
|
66
71
|
ffi (>= 1.0.11)
|
67
|
-
listen (2.
|
68
|
-
celluloid (
|
72
|
+
listen (2.10.0)
|
73
|
+
celluloid (~> 0.16.0)
|
69
74
|
rb-fsevent (>= 0.9.3)
|
70
75
|
rb-inotify (>= 0.9)
|
71
76
|
little-plugger (1.1.3)
|
@@ -74,12 +79,16 @@ GEM
|
|
74
79
|
multi_json (>= 1.8.4)
|
75
80
|
lumberjack (1.0.9)
|
76
81
|
method_source (0.8.2)
|
77
|
-
mini_portile (0.6.
|
78
|
-
multi_json (1.
|
82
|
+
mini_portile (0.6.2)
|
83
|
+
multi_json (1.11.0)
|
79
84
|
multi_xml (0.5.5)
|
80
85
|
multipart-post (2.0.0)
|
81
|
-
|
86
|
+
nenv (0.2.0)
|
87
|
+
nokogiri (1.6.6.2)
|
82
88
|
mini_portile (~> 0.6.0)
|
89
|
+
notiffany (0.0.6)
|
90
|
+
nenv (~> 0.1)
|
91
|
+
shellany (~> 0.0)
|
83
92
|
oauth2 (1.0.0)
|
84
93
|
faraday (>= 0.8, < 0.10)
|
85
94
|
jwt (~> 1.0)
|
@@ -90,40 +99,41 @@ GEM
|
|
90
99
|
coderay (~> 1.1.0)
|
91
100
|
method_source (~> 0.8.1)
|
92
101
|
slop (~> 3.4)
|
93
|
-
rack (1.
|
102
|
+
rack (1.6.1)
|
94
103
|
rake (10.4.2)
|
95
|
-
rb-fsevent (0.9.
|
104
|
+
rb-fsevent (0.9.5)
|
96
105
|
rb-inotify (0.9.5)
|
97
106
|
ffi (>= 0.5.0)
|
98
107
|
rdoc (4.2.0)
|
99
|
-
|
100
|
-
|
101
|
-
rspec-
|
102
|
-
rspec-
|
103
|
-
rspec-mocks (~> 3.1.0)
|
108
|
+
rspec (3.2.0)
|
109
|
+
rspec-core (~> 3.2.0)
|
110
|
+
rspec-expectations (~> 3.2.0)
|
111
|
+
rspec-mocks (~> 3.2.0)
|
104
112
|
rspec-collection_matchers (1.1.2)
|
105
113
|
rspec-expectations (>= 2.99.0.beta1)
|
106
|
-
rspec-core (3.
|
107
|
-
rspec-support (~> 3.
|
108
|
-
rspec-expectations (3.1
|
114
|
+
rspec-core (3.2.3)
|
115
|
+
rspec-support (~> 3.2.0)
|
116
|
+
rspec-expectations (3.2.1)
|
109
117
|
diff-lcs (>= 1.2.0, < 2.0)
|
110
|
-
rspec-support (~> 3.
|
111
|
-
rspec-mocks (3.1
|
112
|
-
|
113
|
-
|
118
|
+
rspec-support (~> 3.2.0)
|
119
|
+
rspec-mocks (3.2.1)
|
120
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
121
|
+
rspec-support (~> 3.2.0)
|
122
|
+
rspec-support (3.2.2)
|
114
123
|
safe_yaml (1.0.4)
|
115
|
-
|
124
|
+
shellany (0.0.1)
|
125
|
+
simplecov (0.10.0)
|
116
126
|
docile (~> 1.1.0)
|
117
|
-
|
118
|
-
simplecov-html (~> 0.
|
119
|
-
simplecov-html (0.
|
127
|
+
json (~> 1.8)
|
128
|
+
simplecov-html (~> 0.10.0)
|
129
|
+
simplecov-html (0.10.0)
|
120
130
|
slop (3.6.0)
|
121
131
|
spork (0.9.2)
|
122
132
|
thor (0.19.1)
|
123
|
-
thread_safe (0.3.
|
133
|
+
thread_safe (0.3.5)
|
124
134
|
timers (4.0.1)
|
125
135
|
hitimes
|
126
|
-
webmock (1.
|
136
|
+
webmock (1.21.0)
|
127
137
|
addressable (>= 2.3.6)
|
128
138
|
crack (>= 0.3.2)
|
129
139
|
yard (0.8.7.6)
|
@@ -150,3 +160,6 @@ DEPENDENCIES
|
|
150
160
|
spork (~> 0.9)
|
151
161
|
webmock (~> 1.20)
|
152
162
|
yard (~> 0.8)
|
163
|
+
|
164
|
+
BUNDLED WITH
|
165
|
+
1.10.3
|
data/README.md
CHANGED
@@ -14,7 +14,8 @@ The API documentation can be find at [RubyDoc](http://www.rubydoc.info/github/dd
|
|
14
14
|
This gem requires Ruby 2.x and is tested with:
|
15
15
|
|
16
16
|
- Ruby 2.0.0
|
17
|
-
- Ruby 2.1.
|
17
|
+
- Ruby 2.1.6
|
18
|
+
- Ruby 2.2.2
|
18
19
|
|
19
20
|
## Usage
|
20
21
|
|
@@ -64,12 +65,14 @@ checker.check('http://www.google.com/')
|
|
64
65
|
|
65
66
|
### ReportingUrlChecker
|
66
67
|
|
67
|
-
For a nice looking report, use [`NDD::UrlChecker::ReportingUrlChecker`](http://www.rubydoc.info/github/ddidier/ndd-url_checker/NDD/UrlChecker/ReportingUrlChecker) which enables reporting capabilities using ERB templates. Several built-in templates are provided: CSV
|
68
|
+
For a nice looking report, use [`NDD::UrlChecker::ReportingUrlChecker`](http://www.rubydoc.info/github/ddidier/ndd-url_checker/NDD/UrlChecker/ReportingUrlChecker) which enables reporting capabilities using ERB templates. Several built-in templates are provided: CSV, HTML and JSON.
|
68
69
|
|
69
70
|
```ruby
|
70
71
|
checker = NDD::UrlChecker:: ReportingUrlChecker.new(delegate_checker)
|
71
72
|
statuses = checker.check('http://www.invalid123456789.com/', 'http://www.google.com/')
|
73
|
+
report_as_text = checker.report(:csv, '/some/report.csv')
|
72
74
|
report_as_text = checker.report(:html, '/some/report.html')
|
75
|
+
report_as_text = checker.report(:json, '/some/report.json')
|
73
76
|
report_as_text = checker.report('/some/template.erb', '/some/report.html')
|
74
77
|
```
|
75
78
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2a
|
data/lib/ndd/url_checker.rb
CHANGED
@@ -2,5 +2,7 @@ require 'ndd/url_checker/abstract_url_checker'
|
|
2
2
|
require 'ndd/url_checker/blocking_url_checker'
|
3
3
|
require 'ndd/url_checker/forked_url_checker'
|
4
4
|
require 'ndd/url_checker/parallel_url_checker'
|
5
|
+
require 'ndd/url_checker/reporting_url_checker'
|
5
6
|
require 'ndd/url_checker/status'
|
7
|
+
require 'ndd/url_checker/status_decorator'
|
6
8
|
require 'ndd/url_checker/threaded_url_checker'
|
@@ -25,7 +25,7 @@ module NDD
|
|
25
25
|
# @return [NDD::UrlChecker::Status, Array<NDD::UrlChecker::Status>] a single status for a single URL, an array
|
26
26
|
# of status for multiple parameters
|
27
27
|
def check(*urls)
|
28
|
-
@logger.
|
28
|
+
@logger.debug "Checking #{urls.size} URL(s)"
|
29
29
|
return check_single(urls.first) if urls.size < 2
|
30
30
|
urls.map { |url| check_single(url) }
|
31
31
|
end
|
@@ -40,12 +40,13 @@ module NDD
|
|
40
40
|
def check_single(url)
|
41
41
|
begin
|
42
42
|
@logger.debug "Checking: #{url}"
|
43
|
-
status =
|
43
|
+
status = Status.new(url)
|
44
|
+
status = check_uri(URI.parse(url), status)
|
44
45
|
rescue => error
|
45
46
|
status = if unknown_host?(error)
|
46
|
-
|
47
|
+
status.unknown_host
|
47
48
|
else
|
48
|
-
|
49
|
+
status.failed(error)
|
49
50
|
end
|
50
51
|
end
|
51
52
|
@logger.debug "Checked: #{url} -> #{status.code.upcase}"
|
@@ -91,6 +92,8 @@ module NDD
|
|
91
92
|
end
|
92
93
|
|
93
94
|
def on_error(uri, response, status)
|
95
|
+
# read the body while the socket is still open
|
96
|
+
response.body if response.kind_of?(Net::HTTPResponse)
|
94
97
|
status.failed(response)
|
95
98
|
end
|
96
99
|
|
@@ -42,9 +42,11 @@ module NDD
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# read back the results
|
45
|
-
results = urls.map do |_|
|
45
|
+
results = urls.each_with_index.map do |_, index|
|
46
46
|
result = result_pipe.get
|
47
|
-
|
47
|
+
processed_number = index + 1
|
48
|
+
processed_percentage = processed_number.to_f / urls.size.to_f * 100.0
|
49
|
+
@logger.debug("Processed URLs #{processed_number}/#{urls.size} (#{processed_percentage.round(2)} %)")
|
48
50
|
result
|
49
51
|
end
|
50
52
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Index,URL,Result,Code,
|
2
|
-
<%
|
1
|
+
Index,URL,Result,Code,Details
|
2
|
+
<% statuses.each_with_index do |status, index| %>
|
3
3
|
<%= index+1 %>,<%= status.uri %>,<%= status.valid? ? 'valid' : 'invalid' %>,<%= status.code %>,<% if status.invalid? %><%= status.error %><% end %>
|
4
4
|
<% end %>
|
@@ -2,96 +2,187 @@
|
|
2
2
|
<html lang="en">
|
3
3
|
|
4
4
|
<head>
|
5
|
-
<meta charset="UTF-8"
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
|
8
|
+
<style type="text/css">
|
9
|
+
.popover-title {
|
10
|
+
font-weight: bold;
|
11
|
+
}
|
12
|
+
|
13
|
+
.popover-content em {
|
14
|
+
font-style: normal;
|
15
|
+
font-weight: bold;
|
16
|
+
}
|
17
|
+
|
18
|
+
.popover-content ol {
|
19
|
+
margin-left: -20px;
|
20
|
+
}
|
11
21
|
</style>
|
12
22
|
|
13
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.
|
14
|
-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.
|
23
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
24
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
15
25
|
<script language="JavaScript">
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
26
|
+
if (!window.ndd_url_checker) {
|
27
|
+
window.ndd_url_checker = {};
|
28
|
+
}
|
29
|
+
|
30
|
+
ndd_url_checker.STATES = ['direct', 'redirected', 'failed', 'too-many-redirects', 'unknown-host'];
|
31
|
+
|
32
|
+
ndd_url_checker.displayStates = function () {
|
33
|
+
var displayStates = {};
|
34
|
+
$.each(ndd_url_checker.STATES, function (_, state) {
|
35
|
+
var checked = $('.display-' + state).is(':checked');
|
36
|
+
displayStates[state] = checked;
|
37
|
+
});
|
38
|
+
return displayStates;
|
39
|
+
}
|
40
|
+
|
41
|
+
ndd_url_checker.filter = function () {
|
42
|
+
var displayStates = ndd_url_checker.displayStates();
|
43
|
+
|
44
|
+
$.each(displayStates, function (state, display) {
|
45
|
+
$('.result-' + state).toggle(display);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
$(document).ready(function () {
|
50
|
+
// show or hide results depending on their state
|
51
|
+
$.each(ndd_url_checker.STATES, function (_, state) {
|
52
|
+
$('.display-' + state).change(function () {
|
53
|
+
ndd_url_checker.filter();
|
54
|
+
});
|
55
|
+
});
|
56
|
+
|
57
|
+
// activate all tooltips
|
58
|
+
$('[data-toggle="popover"]')
|
59
|
+
.popover()
|
60
|
+
.click(function (e) {
|
61
|
+
e.preventDefault();
|
62
|
+
});
|
24
63
|
});
|
25
|
-
});
|
26
64
|
</script>
|
27
65
|
</head>
|
28
66
|
|
67
|
+
|
29
68
|
<body>
|
30
69
|
|
31
|
-
<
|
32
|
-
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
</
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
</
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
<
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
<
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
70
|
+
<div class="container">
|
71
|
+
|
72
|
+
<div class="page-header">
|
73
|
+
<h1>
|
74
|
+
<span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
|
75
|
+
URL Checker Report
|
76
|
+
</h1>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<div class="row">
|
81
|
+
<div class="col-md-4">
|
82
|
+
<dl class="page-info dl-horizontal">
|
83
|
+
<dt>Number of URLs</dt>
|
84
|
+
<dd><%= urls.count %></dd>
|
85
|
+
<dt>Duration</dt>
|
86
|
+
<dd><%= benchmark.total_duration.round(3) %> s</dd>
|
87
|
+
<dt>Average duration</dt>
|
88
|
+
<dd><%= benchmark.average_duration.round(3) %> s/URL</dd>
|
89
|
+
<dt>Average throughput</dt>
|
90
|
+
<dd><%= benchmark.average_throughput.round(3) %> URL/s</dd>
|
91
|
+
</dl>
|
92
|
+
</div>
|
93
|
+
<div class="col-md-4">
|
94
|
+
<dl class="page-info dl-horizontal">
|
95
|
+
<dt>Valid URLS</dt>
|
96
|
+
<dd><%= urls.valid_count %></dd>
|
97
|
+
<dt>direct</dt>
|
98
|
+
<dd><%= urls.direct_count %></dd>
|
99
|
+
<dt>redirected</dt>
|
100
|
+
<dd><%= urls.redirected_count %></dd>
|
101
|
+
</dl>
|
102
|
+
</div>
|
103
|
+
<div class="col-md-4">
|
104
|
+
<dl class="page-info dl-horizontal">
|
105
|
+
<dt>Invalid URLS</dt>
|
106
|
+
<dd><%= urls.invalid_count %></dd>
|
107
|
+
<dt>failed</dt>
|
108
|
+
<dd><%= urls.failed_count %></dd>
|
109
|
+
<dt>too many redirects</dt>
|
110
|
+
<dd><%= urls.too_many_redirects_count %></dd>
|
111
|
+
<dt>unknown host</dt>
|
112
|
+
<dd><%= urls.unknown_host_count %></dd>
|
113
|
+
</dl>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<hr />
|
117
|
+
|
118
|
+
|
119
|
+
<div class="row page-controls hidden-print">
|
120
|
+
<div class="col-md-6">
|
121
|
+
<span>Valid URLs:</span>
|
74
122
|
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
<
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
123
|
+
<div class="btn-group page-display" data-toggle="buttons">
|
124
|
+
<label class="btn btn-default active">
|
125
|
+
<input type="checkbox" autocomplete="off" class="display-direct" checked="true" />
|
126
|
+
Direct (<%= urls.direct_count %>)
|
127
|
+
</label>
|
128
|
+
<label class="btn btn-default active">
|
129
|
+
<input type="checkbox" autocomplete="off" class="display-redirected" checked="true" />
|
130
|
+
Redirected (<%= urls.redirected_count %>)
|
131
|
+
</label>
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
<div class="col-md-6">
|
135
|
+
<span>Invalid URLs:</span>
|
136
|
+
|
137
|
+
<div class="btn-group page-display" data-toggle="buttons">
|
138
|
+
<label class="btn btn-default active">
|
139
|
+
<input type="checkbox" autocomplete="off" class="display-failed" checked="true" />
|
140
|
+
Failed (<%= urls.failed_count %>)
|
141
|
+
</label>
|
142
|
+
<label class="btn btn-default active">
|
143
|
+
<input type="checkbox" autocomplete="off" class="display-too-many-redirects" checked="true" />
|
144
|
+
Too many redirects (<%= urls.too_many_redirects_count %>)
|
145
|
+
</label>
|
146
|
+
<label class="btn btn-default active">
|
147
|
+
<input type="checkbox" autocomplete="off" class="display-unknown-host" checked="true" />
|
148
|
+
Unknown host (<%= urls.unknown_host_count %>)
|
149
|
+
</label>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
<hr />
|
154
|
+
|
155
|
+
|
156
|
+
<table id="results" class="table table-condensed table-hover">
|
157
|
+
<thead>
|
158
|
+
<tr>
|
159
|
+
<th>#</th>
|
160
|
+
<th>URL</th>
|
161
|
+
<th>Code</th>
|
162
|
+
<th>Details</th>
|
163
|
+
</tr>
|
164
|
+
</thead>
|
165
|
+
<tbody>
|
166
|
+
<% statuses.each_with_index do |status, index| %>
|
167
|
+
<tr class="result result-<%= status.code_as_css %> <%= status.invalid? ? 'danger' : '' %>">
|
168
|
+
<td><%= index+1 %></td>
|
169
|
+
<td><a href="<%= status.uri %>" target="_blank"><%= status.uri %></a></td>
|
170
|
+
<td><%= status.code %></td>
|
171
|
+
<td><%= status.details_title %></td>
|
172
|
+
<td>
|
173
|
+
<% if status.details_body %>
|
174
|
+
<a href="#" data-toggle="popover" data-placement="left" data-trigger="focus"
|
175
|
+
data-html="true" title="<%= status.uri %>" data-content="<%= status.details_body_as_html %>">
|
176
|
+
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
177
|
+
</a>
|
178
|
+
<% end %>
|
179
|
+
</td>
|
180
|
+
</tr>
|
181
|
+
<% end %>
|
182
|
+
</tbody>
|
183
|
+
</table>
|
184
|
+
|
185
|
+
</div>
|
95
186
|
|
96
187
|
</body>
|
97
188
|
</html>
|