site_validator 1.0.1 → 1.0.2
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/lib/site_validator/sitemap.rb +2 -2
- data/lib/site_validator/version.rb +1 -1
- data/site_validator.gemspec +1 -1
- data/spec/sitemap_spec.rb +2 -2
- metadata +8 -8
|
@@ -55,10 +55,10 @@ module SiteValidator
|
|
|
55
55
|
def pages_in_sitemap
|
|
56
56
|
pages = xml_locations.select {|loc| looks_like_html?(loc.text)}.map {|loc| SiteValidator::Page.new(loc.text)}
|
|
57
57
|
if pages.empty?
|
|
58
|
-
m = MetaInspector.new(url, timeout)
|
|
58
|
+
m = MetaInspector.new(url, :timeout => timeout)
|
|
59
59
|
links = [m.url]
|
|
60
60
|
|
|
61
|
-
m.
|
|
61
|
+
m.internal_links.select {|l| looks_like_html?(l)}.map {|l| l.split('#')[0]}.uniq.each do |link|
|
|
62
62
|
if link[-1,1] == "/"
|
|
63
63
|
links << link unless (links.include?(link) || links.include?(link.chop))
|
|
64
64
|
else
|
data/site_validator.gemspec
CHANGED
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
|
17
17
|
|
|
18
18
|
gem.add_dependency 'w3c_validators', '~> 1.2'
|
|
19
19
|
gem.add_dependency 'nokogiri', '~> 1.5.3'
|
|
20
|
-
gem.add_dependency 'metainspector', '1.
|
|
20
|
+
gem.add_dependency 'metainspector', '~> 1.10.1'
|
|
21
21
|
|
|
22
22
|
gem.add_development_dependency 'rspec', '~> 2.5.0'
|
|
23
23
|
gem.add_development_dependency 'mocha', '~> 0.11.4'
|
data/spec/sitemap_spec.rb
CHANGED
|
@@ -115,8 +115,8 @@ describe SiteValidator::Sitemap do
|
|
|
115
115
|
it "should not crash when URLs have international characters" do
|
|
116
116
|
@sitemap_international.pages.length.should == 9
|
|
117
117
|
@sitemap_international.pages[0].url.should == 'http://example.com/international'
|
|
118
|
-
@sitemap_international.pages[1].url.should == 'http://example.com/
|
|
119
|
-
@sitemap_international.pages[2].url.should == 'http://example.com/
|
|
118
|
+
@sitemap_international.pages[1].url.should == 'http://example.com/roman%C3%A9e'
|
|
119
|
+
@sitemap_international.pages[2].url.should == 'http://example.com/espa%C3%B1a'
|
|
120
120
|
@sitemap_international.pages[3].url.should == 'http://example.com/roman%C3%A9e-2'
|
|
121
121
|
@sitemap_international.pages[4].url.should == 'http://example.com/espa%C3%B1a-2'
|
|
122
122
|
@sitemap_international.pages[5].url.should == 'http://example.com/search?q=espa%C3%B1a'
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: site_validator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 1.0.
|
|
9
|
+
- 2
|
|
10
|
+
version: 1.0.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jaime Iniesta
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-11-
|
|
18
|
+
date: 2012-11-16 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: w3c_validators
|
|
@@ -54,14 +54,14 @@ dependencies:
|
|
|
54
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
|
55
55
|
none: false
|
|
56
56
|
requirements:
|
|
57
|
-
- -
|
|
57
|
+
- - ~>
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
hash:
|
|
59
|
+
hash: 61
|
|
60
60
|
segments:
|
|
61
61
|
- 1
|
|
62
|
-
- 9
|
|
63
62
|
- 10
|
|
64
|
-
|
|
63
|
+
- 1
|
|
64
|
+
version: 1.10.1
|
|
65
65
|
type: :runtime
|
|
66
66
|
version_requirements: *id003
|
|
67
67
|
- !ruby/object:Gem::Dependency
|