feedvalidator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG +3 -0
  2. data/lib/feed_validator.rb +9 -4
  3. data/rakefile +1 -1
  4. 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
@@ -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.0"
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
- @response = Net::HTTP.start('validator.w3.org',80).post('/feed/check.cgi',params)
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
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
7
7
  require 'rake/contrib/rubyforgepublisher'
8
8
 
9
9
  PKG_NAME = 'feedvalidator'
10
- PKG_VERSION = '0.1.0'
10
+ PKG_VERSION = '0.1.1'
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
13
13
  RELEASE_NAME = "REL #{PKG_VERSION}"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.10
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.0
7
- date: 2006-04-11
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
- - lib
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
- - !ruby/object:Gem::Version
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
- - Edgar Gonzalez
30
+ - Edgar Gonzalez
29
31
  files:
30
- - rakefile
31
- - install.rb
32
- - README
33
- - CHANGELOG
34
- - lib/feed_validator
35
- - lib/feed_validator.rb
36
- - lib/feed_validator/assertions.rb
37
- - test/feeds
38
- - test/responses
39
- - test/unit
40
- - test/feeds/weblog.rubyonrails.org_rss_2_0_articles.xml
41
- - test/feeds/www.w3.org_news.rss.xml
42
- - test/responses/success_with_warnings
43
- - test/unit/feed_validator_assertions_test.rb
44
- - test/unit/feed_validator_test.rb
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
- - "--main"
48
- - README
50
+ - --main
51
+ - README
49
52
  extra_rdoc_files:
50
- - README
53
+ - README
51
54
  executables: []
55
+
52
56
  extensions: []
57
+
53
58
  requirements: []
54
- dependencies: []
59
+
60
+ dependencies: []
61
+