url_scrubber 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +8 -1
- metadata +2 -2
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
@@ -16,6 +16,7 @@ module UrlScrubber
|
|
16
16
|
url.sub!('#!/', '')
|
17
17
|
url = downcase_domain(url)
|
18
18
|
remove_www!(url)
|
19
|
+
Rails.logger.debug "URLSCRUBBER - url1 = #{url}"
|
19
20
|
drop_anchor!(special_cases(url))
|
20
21
|
end
|
21
22
|
|
@@ -24,7 +25,7 @@ module UrlScrubber
|
|
24
25
|
domain_match = url.match(%r{https?://([^/]+)})
|
25
26
|
|
26
27
|
if domain_match
|
27
|
-
domain = domain_match[1]
|
28
|
+
domain = domain_match[1]
|
28
29
|
first_dot = domain.index(".")
|
29
30
|
|
30
31
|
#first_dot_position = domain.index(".")
|
@@ -175,10 +176,16 @@ module UrlScrubber
|
|
175
176
|
url.sub!('com/u/0/b/', 'com/')
|
176
177
|
url.sub!('com/u/0/', 'com/')
|
177
178
|
url.sub!('com/b/', 'com/')
|
179
|
+
url.sub!('/photos', '')
|
180
|
+
url.sub!('/of', '')
|
181
|
+
url.sub!('/albums', '')
|
182
|
+
Rails.logger.debug "URLSCRUBBER - url3 = #{url}"
|
178
183
|
|
179
184
|
path_match = url.match(/^http:\/\/plus\.google\.com\/([^\/]+)/)
|
185
|
+
Rails.logger.debug "URLSCRUBBER - path_match = #{path_match}"
|
180
186
|
return url unless path_match
|
181
187
|
|
188
|
+
Rails.logger.debug "URLSCRUBBER - no match url = http://plus.google.com/#{path_match[1]}"
|
182
189
|
"http://plus.google.com/#{path_match[1]}"
|
183
190
|
end
|
184
191
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_scrubber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-09-
|
14
|
+
date: 2013-09-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|