lib/postrank-uri.rb in postrank-uri-1.0.9 vs lib/postrank-uri.rb in postrank-uri-1.0.10
- old
+ new
@@ -132,11 +132,11 @@
uri = normalize(c18n(unescape(uri)))
opts[:raw] ? uri : uri.to_s
end
def hash(uri, opts = {})
- Digest::MD5.hexdigest(opts[:skip_clean] ? uri : clean(uri))
+ Digest::MD5.hexdigest(opts[:clean] == false ? uri : clean(uri))
end
def normalize(uri)
u = parse(uri)
u.path = u.path.squeeze('/')
@@ -157,9 +157,13 @@
u.query_values = q
if u.host == 'twitter.com' && u.fragment && u.fragment.match(/^!(.*)/)
u.fragment = nil
u.path = $1
+ end
+
+ if u.host =~ /tumblr\.com$/
+ u.path = u.path.gsub(/[^\/]+$/, '')
end
u
end
\ No newline at end of file