url_scrubber 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc1cea704c5440cf1114fe0ab1a013963bb0184f
4
- data.tar.gz: 15e202c908bc49f2dd65aa1ab8bdb482bdc0fa71
3
+ metadata.gz: e6ae9b76fdd2922fcee550e8fbaf31dd6eb0b68f
4
+ data.tar.gz: f8baf698401f55685a7d00d70971bf8ebca7182b
5
5
  SHA512:
6
- metadata.gz: e12356b808e46f5e2bb292105eb69b001b9a7ef42c65908351bfac100fd5bcbc29cffe8740ad75e0e55ea1b2fd0a8981f101333ad3198718ce743a3fb2721f7f
7
- data.tar.gz: 4b0961d123a5962dc027e82e11b43ac6135bebf94ac92e6462af1634e4734fb90d63dea6edd146ec09f76903416522d535a2f8f3845500b71b1bc213c0d21e0c
6
+ metadata.gz: 1ca6fd80cded808748bafc296bc90c9a562374da6887c9ed0823c193ee79b09ddc82a322e958975fb169ca2038df6ac81d70e357e2e43a6d82fc9b921c631ff3
7
+ data.tar.gz: 5a67da704ed0ed900aaed96b01f1fd98b447b8fd0c2789c99d95f12b7eadfac149cbe274c1b62724ce02321a367aebdd86e6471f9ba85627c86c637252d544bf
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.7.11"
2
+ VERSION = "0.7.12"
3
3
  end
data/lib/url_scrubber.rb CHANGED
@@ -133,14 +133,14 @@ module UrlScrubber
133
133
 
134
134
  def self.special_cases(url)
135
135
  case service_of(url)
136
- when :youtube then return youtube(url)
137
- when :twitter then return twitter(url)
138
- when :facebook then return facebook(url)
139
- when :linkedin then return linkedin(url)
140
- when :google then return google_plus(url)
141
- when :flickr then return flickr(url)
142
- when :pinterest then return pinterest(url)
143
- when :yelp then return yelp(url)
136
+ when :youtube then return sc_youtube(url)
137
+ when :twitter then return sc_twitter(url)
138
+ when :facebook then return sc_facebook(url)
139
+ when :linkedin then return sc_linkedin(url)
140
+ when :google then return sc_google_plus(url)
141
+ when :flickr then return sc_flickr(url)
142
+ when :pinterest then return sc_pinterest(url)
143
+ when :yelp then return sc_yelp(url)
144
144
  end
145
145
 
146
146
  url
@@ -166,13 +166,13 @@ module UrlScrubber
166
166
  url
167
167
  end
168
168
 
169
- def self.youtube(url)
169
+ def self.sc_youtube(url)
170
170
  url.sub!('youtube.com/user/', 'youtube.com/')
171
171
  url.sub!('youtube.com/profile?user=', 'youtube.com/')
172
172
  url
173
173
  end
174
174
 
175
- def self.twitter(url)
175
+ def self.sc_twitter(url)
176
176
  url.sub!('twitter.com/@', 'twitter.com/')
177
177
 
178
178
  status_match = url.match(%r{(twitter\.com/[^/]+)/statuses/\d+})
@@ -188,7 +188,7 @@ module UrlScrubber
188
188
  url
189
189
  end
190
190
 
191
- def self.facebook(url)
191
+ def self.sc_facebook(url)
192
192
  if url.match("/media/albums") || url.match("/media/set")
193
193
  url = url.match('\&') ? url.split('&',2)[0] : url
194
194
  elsif url.include?("facebook.com/profile.php?id=")
@@ -202,7 +202,7 @@ module UrlScrubber
202
202
  url
203
203
  end
204
204
 
205
- def self.linkedin(url)
205
+ def self.sc_linkedin(url)
206
206
 
207
207
  url.sub!('linkedin.com/companies/', 'linkedin.com/company/')
208
208
  if !!url.match(%r{com/company/})
@@ -221,7 +221,7 @@ module UrlScrubber
221
221
  url
222
222
  end
223
223
 
224
- def self.google_plus(url)
224
+ def self.sc_google_plus(url)
225
225
  url.sub!('com/u/0/b/', 'com/')
226
226
  url.sub!('com/u/0/', 'com/')
227
227
  url.sub!('com/b/', 'com/')
@@ -235,18 +235,18 @@ module UrlScrubber
235
235
  "http://plus.google.com/#{path_match[1]}"
236
236
  end
237
237
 
238
- def self.flickr(url)
238
+ def self.sc_flickr(url)
239
239
  user_match = url.match(%r{flickr\.com/(photos/|people/)?([^/]+)})
240
240
  return url unless user_match
241
241
 
242
242
  "http://flickr.com/#{user_match[2]}"
243
243
  end
244
244
 
245
- def self.pinterest(url)
245
+ def self.sc_pinterest(url)
246
246
  url
247
247
  end
248
248
 
249
- def self.yelp(url)
249
+ def self.sc_yelp(url)
250
250
  url
251
251
  end
252
252
 
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.11
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Langton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-02-03 00:00:00.000000000 Z
14
+ date: 2014-02-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec