stopango_tester 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/stopango_tester.rb +0 -3
- data/lib/stopango_tester/fetcher.rb +6 -3
- data/lib/stopango_tester/report.rb +10 -1
- data/lib/stopango_tester/version.rb +1 -1
- metadata +6 -6
data/bin/stopango_tester.rb
CHANGED
@@ -36,14 +36,15 @@ module StopangoTester
|
|
36
36
|
request = hydra_request(record.test_url)
|
37
37
|
|
38
38
|
request.on_complete do |response|
|
39
|
-
|
39
|
+
report = Report.new(record,response)
|
40
|
+
reports << report.to_json
|
41
|
+
puts report
|
40
42
|
end
|
41
43
|
|
42
44
|
hydra.queue request
|
43
45
|
end
|
44
46
|
hydra.run
|
45
47
|
|
46
|
-
|
47
48
|
# send reports
|
48
49
|
puts "wysylam raport"
|
49
50
|
reports.each do |report|
|
@@ -69,7 +70,9 @@ module StopangoTester
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def hydra
|
72
|
-
@hydra ||= Typhoeus::Hydra.new
|
73
|
+
@hydra ||= Typhoeus::Hydra.new(
|
74
|
+
max_concurrency: config['max_concurrency'] || 1
|
75
|
+
)
|
73
76
|
end
|
74
77
|
|
75
78
|
def test_records
|
@@ -9,7 +9,6 @@ module StopangoTester
|
|
9
9
|
# field :time, type: Float
|
10
10
|
# field :status
|
11
11
|
def to_json
|
12
|
-
hash = Hash.new
|
13
12
|
hash[:named_fid] = record.named_fid
|
14
13
|
hash[:status] = response.code
|
15
14
|
hash[:url] = ::CGI.escape(record.test_url)
|
@@ -19,6 +18,16 @@ module StopangoTester
|
|
19
18
|
hash
|
20
19
|
end
|
21
20
|
|
21
|
+
def hash
|
22
|
+
@hash ||= Hash.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_s
|
26
|
+
"\nurl: #{URI.decode(hash[:url])}\n" +
|
27
|
+
" status: #{hash[:status]}\n" +
|
28
|
+
" time: #{hash[:time]}"
|
29
|
+
end
|
30
|
+
|
22
31
|
private
|
23
32
|
|
24
33
|
def error?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stopango_tester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|
16
|
-
requirement: &
|
16
|
+
requirement: &70356943109460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70356943109460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: typhoeus
|
27
|
-
requirement: &
|
27
|
+
requirement: &70356943109040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70356943109040
|
36
36
|
description: Something later maybe
|
37
37
|
email:
|
38
38
|
- lewy313@gmail.com
|