feedvalidator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/lib/feed_validator.rb +9 -4
- data/rakefile +1 -1
- metadata +35 -28
data/CHANGELOG
CHANGED
@@ -1,2 +1,5 @@
|
|
1
|
+
== FeedValidator 0.1.1
|
2
|
+
* This release is an adjustment to workaround a bug in Net::HTTP#post in ruby 1.8.4 (see http://rubyforge.org/tracker/?func=detail&atid=1698&aid=4782&group_id=426).
|
3
|
+
* The W3C::FeedValidator.validate_data changed to in case ruby version is 1.8.4 send the right Content-Type header in the post.
|
1
4
|
== FeedValidator 0.1.0
|
2
5
|
* Added the basic features to validate feeds, and new assertions to test cases
|
data/lib/feed_validator.rb
CHANGED
@@ -39,7 +39,7 @@ module W3C
|
|
39
39
|
# so do not abuse it: you should make your scripts sleep between requests.
|
40
40
|
#
|
41
41
|
class FeedValidator
|
42
|
-
VERSION = "0.1.
|
42
|
+
VERSION = "0.1.1"
|
43
43
|
|
44
44
|
# True if the w3c feed validation service not found errors in the feed.
|
45
45
|
#
|
@@ -80,10 +80,14 @@ module W3C
|
|
80
80
|
clear
|
81
81
|
params = "rawdata=#{CGI.escape(rawdata)}&manual=1&output=soap12"
|
82
82
|
begin
|
83
|
-
|
83
|
+
headers = ::VERSION == "1.8.4" ? {'Content-Type'=>'application/x-www-form-urlencoded'} : {}
|
84
|
+
@response = Net::HTTP.start('validator.w3.org',80) {|http|
|
85
|
+
http.post('/feed/check.cgi',params,headers)
|
86
|
+
}
|
84
87
|
parse_response(@response.body)
|
85
88
|
return true
|
86
|
-
rescue
|
89
|
+
rescue Exception => e
|
90
|
+
warn "Exception: #{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}" if $VERBOSE
|
87
91
|
return false
|
88
92
|
end
|
89
93
|
end
|
@@ -98,7 +102,8 @@ module W3C
|
|
98
102
|
@response = Net::HTTP.get_response('validator.w3.org',"/feed/check.cgi?#{params}",80)
|
99
103
|
parse_response(@response.body)
|
100
104
|
return true
|
101
|
-
rescue
|
105
|
+
rescue Exception => e
|
106
|
+
warn "Exception: #{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}" if $VERBOSE
|
102
107
|
return false
|
103
108
|
end
|
104
109
|
end
|
data/rakefile
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: feedvalidator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2006-04
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2006-08-16 00:00:00 -04:00
|
8
8
|
summary: An interface to the W3C Feed Validation online service
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: edgar@lacaraoscura.com
|
12
12
|
homepage: http://feedvalidator.rubyforge.org
|
13
13
|
rubyforge_project: feedvalidator
|
@@ -18,37 +18,44 @@ bindir: bin
|
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
25
24
|
version:
|
26
25
|
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
27
29
|
authors:
|
28
|
-
|
30
|
+
- Edgar Gonzalez
|
29
31
|
files:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
- rakefile
|
33
|
+
- install.rb
|
34
|
+
- README
|
35
|
+
- CHANGELOG
|
36
|
+
- lib/feed_validator
|
37
|
+
- lib/feed_validator.rb
|
38
|
+
- lib/feed_validator/assertions.rb
|
39
|
+
- test/feeds
|
40
|
+
- test/responses
|
41
|
+
- test/unit
|
42
|
+
- test/feeds/weblog.rubyonrails.org_rss_2_0_articles.xml
|
43
|
+
- test/feeds/www.w3.org_news.rss.xml
|
44
|
+
- test/responses/success_with_warnings
|
45
|
+
- test/unit/feed_validator_assertions_test.rb
|
46
|
+
- test/unit/feed_validator_test.rb
|
45
47
|
test_files: []
|
48
|
+
|
46
49
|
rdoc_options:
|
47
|
-
|
48
|
-
|
50
|
+
- --main
|
51
|
+
- README
|
49
52
|
extra_rdoc_files:
|
50
|
-
|
53
|
+
- README
|
51
54
|
executables: []
|
55
|
+
|
52
56
|
extensions: []
|
57
|
+
|
53
58
|
requirements: []
|
54
|
-
|
59
|
+
|
60
|
+
dependencies: []
|
61
|
+
|