golia 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -6
- data/golia.gemspec +1 -1
- data/lib/golia.rb +5 -5
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -32,14 +32,10 @@ You see an output like that:
|
|
32
32
|
http://padrinorb.com/guides/home
|
33
33
|
http://padrinorb.com/guides/adding-new-components
|
34
34
|
Invalid W3C Links: 37
|
35
|
-
http://validator.
|
36
|
-
http://validator.
|
35
|
+
http://validator.w3c.com/check?uri=http://padrinorb.com/api
|
36
|
+
http://validator.w3c.com/check?uri=http://padrinorb.com/guides
|
37
37
|
Average load time 0.73ms
|
38
38
|
|
39
|
-
== Future
|
40
|
-
|
41
|
-
In future we will add w3c validations.
|
42
|
-
|
43
39
|
== Credits
|
44
40
|
|
45
41
|
This software is created by DAddYE under MIT LICENSE.
|
data/golia.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.description = "Golia is an website performance analyzer. Check speed and dead links."
|
9
9
|
s.default_executable = "golia"
|
10
10
|
s.executables = ["golia"]
|
11
|
-
s.version = "1.3.
|
11
|
+
s.version = "1.3.1"
|
12
12
|
s.date = Time.now.strftime("%Y-%m-%d")
|
13
13
|
s.extra_rdoc_files = Dir["*.rdoc"]
|
14
14
|
s.files = %w(README.rdoc Rakefile golia.gemspec) + Dir["lib/**/*"]
|
data/lib/golia.rb
CHANGED
@@ -13,7 +13,7 @@ class Golia
|
|
13
13
|
end
|
14
14
|
|
15
15
|
@pid = "#{Dir.tmpdir}/golia-#{URI.parse(link).host}"
|
16
|
-
@checked, @links, @ko, @ok, @long, @invalid, @
|
16
|
+
@checked, @links, @ko, @ok, @long, @invalid, @sec = [], [], [], [], [], [], []
|
17
17
|
|
18
18
|
if File.exist?(@pid)
|
19
19
|
puts "<= Founded staled pid"
|
@@ -33,7 +33,7 @@ class Golia
|
|
33
33
|
def parse!(url)
|
34
34
|
begun_at = Time.now
|
35
35
|
response = open(url)
|
36
|
-
@
|
36
|
+
@sec << Time.now-begun_at
|
37
37
|
return if File.extname(url) != ""
|
38
38
|
body = response.read
|
39
39
|
links = body.scan(/href=["'](.+?)["']/m).flatten
|
@@ -71,8 +71,8 @@ class Golia
|
|
71
71
|
@checked << link
|
72
72
|
parse!(link)
|
73
73
|
@ok << link
|
74
|
-
@long << link if @
|
75
|
-
puts "\e[32mOK\e[0m - #{validate!(link)} - (%0.
|
74
|
+
@long << link if @sec.last > 1
|
75
|
+
puts "\e[32mOK\e[0m - #{validate!(link)} - (%0.2fsec) %s" % [@sec.last, link]
|
76
76
|
rescue Exception => e
|
77
77
|
@ko << link
|
78
78
|
puts "\e[31mKO\e[0m %s - %s" % [link, e.message]
|
@@ -96,7 +96,7 @@ class Golia
|
|
96
96
|
@invalid.each do |link|
|
97
97
|
puts " http://validator.lipsiasoft.com/check?uri=#{link}"
|
98
98
|
end
|
99
|
-
puts "Average load time %0.
|
99
|
+
puts "Average load time %0.2fsec" % [@sec.inject(0) { |memo, sec| memo+=sec; memo }/@sec.size]
|
100
100
|
puts
|
101
101
|
kill
|
102
102
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: golia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 1
|
10
|
+
version: 1.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- DAddYE
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-05 00:00:00 +02:00
|
19
19
|
default_executable: golia
|
20
20
|
dependencies: []
|
21
21
|
|