lib/postrank-uri.rb in postrank-uri-1.0.6 vs lib/postrank-uri.rb in postrank-uri-1.0.7

- old
+ new

@@ -138,24 +138,27 @@ q.delete_if { |k,v| C18N[:global].include?(k) } q.delete_if { |k,v| C18N[:hosts].find {|r,p| u.host =~ r && p.include?(k) } } end u.query_values = q - if u.host == 'twitter.com' && u.fragment.match(/^!(.*)/) + if u.host == 'twitter.com' && u.fragment && u.fragment.match(/^!(.*)/) u.fragment = nil u.path = $1 end u end def embedded(uri) - if uri.host == 'news.google.com' && uri.path == '/news/url' \ + embedded = if uri.host == 'news.google.com' && uri.path == '/news/url' \ || uri.host == 'xfruits.com' + uri.query_values['url'] - embedded = uri.query_values['url'] - uri = clean(embedded, false) if embedded + elsif uri.host =~ /myspace\.com/ && uri.path =~ /PostTo/ + embedded = uri.query_values['u'] end + + uri = clean(embedded, false) if embedded uri end def parse(uri) return uri if uri.is_a? Addressable::URI \ No newline at end of file