public
Rubygem
Fork of jmhodges/rfeedparser
Description: rFeedParser is a translation of the Universal Feed Parser from Python into Ruby. It has nearly the exact same behavior.
Homepage: http://rfeedparser.rubyforge.org
Clone URL: git://github.com/technomancy/rfeedparser.git
Remove last traces of ForgivingURI.
technomancy (author)
Tue May 06 16:30:36 -0700 2008
commit  be6782199fba7fcd047042073f7be166ab262400
tree    157937e2a5629cbc2165ffbfddc9560d05f7dd4c
parent  ba01551a9ef955cd3c46901309194ea6fcca1980
...
22
23
24
 
25
26
27
...
22
23
24
25
26
27
28
0
@@ -22,6 +22,7 @@ require 'zlib'
0
 
0
 require 'rubygems'
0
 
0
+
0
 # If available, Nikolai's UTF-8 library will ease use of utf-8 documents.
0
 # See http://git.bitwi.se/ruby-character-encodings.git/.
0
 begin
...
1
 
2
3
4
...
386
387
388
389
 
390
391
392
...
1245
1246
1247
1248
 
1249
1250
 
1251
1252
1253
 
1254
1255
1256
...
1
2
3
4
5
...
387
388
389
 
390
391
392
393
...
1246
1247
1248
 
1249
1250
 
1251
1252
1253
 
1254
1255
1256
1257
0
@@ -1,4 +1,5 @@
0
 #!/usr/bin/env ruby
0
+
0
 module FeedParser
0
 module FeedParserMixin
0
   include FeedParserUtilities
0
@@ -386,7 +387,7 @@ module FeedParserMixin
0
     end
0
 
0
     # resolve relative URIs
0
- if @can_be_relative_uri.include?element and output and not output.empty?
0
+ if @can_be_relative_uri.include?(element) and !output.blank?
0
       output = resolveURI(output)
0
     end
0
 
0
@@ -1245,12 +1246,12 @@ end
0
 def urljoin(base, uri)
0
   urifixer = /^([A-Za-z][A-Za-z0-9+-.]*:\/\/)(\/*)(.*?)/u
0
   uri = uri.sub(urifixer, '\1\3')
0
- pbase = ForgivingURI.parse(base) rescue nil
0
+ pbase = Addressable::URI.parse(base) rescue nil
0
   if pbase && pbase.absolute?
0
- puri = ForgivingURI.parse(uri) rescue nil
0
+ puri = Addressable::URI.parse(uri) rescue nil
0
     if puri && puri.relative?
0
       # ForgivingURI.join does the wrong thing. What the hell.
0
- return ForgivingURI.join(base, uri).to_s.gsub(/[^:]\/{2,}/, '')
0
+ return Addressable::URI.join(base, uri).to_s.gsub(/[^:]\/{2,}/, '')
0
     end
0
   end
0
   return uri

Comments

    No one has commented yet.