url_scrubber 0.7.15 → 0.7.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.7.15"
2
+ VERSION = "0.7.16"
3
3
  end
data/lib/url_scrubber.rb CHANGED
@@ -73,7 +73,7 @@ module UrlScrubber
73
73
  when :linkedin
74
74
  !!url.match(%r{^http://linkedin\.com/pub/[\w-]+/[\w]+/[\w]+/[\w]+$}) || !!url.match(%r{^http://linkedin\.com/in/[\w_-]+$}) || !!url.match(%r{^http://linkedin\.com/(company/[\w_-]+|profile/view\?id=\d+)$}) || !!url.match(%r{^http://linkedin\.com/(groups\?gid=[0-9]+)$}) || !!url.match(%r{^http://linkedin\.com/(groups/[\w_-]+)$})
75
75
  when :google
76
- !!url.match(%r{^http://plus\.google\.com/(\+[\w_-]+|\d+)$})
76
+ !!url.match(%r{^http://plus\.google\.com/(\+[\w_-]+|\d+)$}) || !!url.match(%r{^http://plus\.google\.com/communities/\d+$})
77
77
  when :slideshare
78
78
  !!url.match(%r{^http://slideshare\.net/[\w_-]+$})
79
79
  when :flickr
@@ -254,10 +254,11 @@ module UrlScrubber
254
254
  url.sub!('/of', '')
255
255
  url.sub!('/albums', '')
256
256
 
257
- path_match = url.match(/^http:\/\/plus\.google\.com\/([^\/]+)/)
257
+ community_page = url.include?('plus.google.com/communities/')
258
+ path_match = community_page ? url.match(/^http:\/\/plus\.google\.com\/communities\/([^\/]+)/) : url.match(/^http:\/\/plus\.google\.com\/([^\/]+)/)
258
259
  return url unless path_match
259
260
 
260
- "http://plus.google.com/#{path_match[1]}"
261
+ community_page ? "http://plus.google.com/communities/#{path_match[1]}" : "http://plus.google.com/#{path_match[1]}"
261
262
  end
262
263
 
263
264
  def self.sc_flickr(url)
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.15
4
+ version: 0.7.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-04-09 00:00:00.000000000 Z
15
+ date: 2014-04-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec