url_scrubber 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDM4ZTYzMzA2NTRjNzhjOTI2MjI4MGI3MDdlZjIzYjZmYjQ4ZDUwOA==
4
+ MzRlZTdlZWY1OTRiMWZlMDY0NDI1MWNjNmM4ZmNlZjRhYjYxYWZkMQ==
5
5
  data.tar.gz: !binary |-
6
- NDczYzkxOTc4OGFkNmQzNTI2M2E4Y2E0MGM2NmRhZmQwNWRmZDYwNw==
6
+ ZTBjYjQ4NjBjYjllZGM2Y2I2NjgwY2U1ODliYWM5NjNiNTc4YTFjYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmMxY2U0ZmMwMDYyZjUwYjQ4YjI3OTU2NDZiZjgzYTZhZDY5ODQ3ZTAzM2E4
10
- NTNkNWM0NWMwNTcyYTkwMDlkYzk2MzkyMDY1NjYzMTNlODg0Y2FhYWIxNmUy
11
- ZDgwMjUxNDI3YTk5ZTQ2MTdjZWJkNzcxZGViMzYyZTBjYTI5NDY=
9
+ YTFhMDdiZjhjNGZmY2RmODczYmIyNTYxNWM0YzM0MmEwYWIzNTUwYTFkMzM3
10
+ ZDMwOGYxNmZhMDYwMWIyOTNhODQ3MjdiNGE5NzY3Nzk0NGJhNTNiOGIwZTA2
11
+ YWJkZjAxOTQ1ODk3ODE4YmQ4MTUyMDJlYWY5NTc1MTIxNjBmMjk=
12
12
  data.tar.gz: !binary |-
13
- ZDRkYjJmNjY2ZWQ5N2IxNzE2MWYxNGNmODJhNDJmNjc0OTkyZjIzOTYxMzMx
14
- NGVkZjE4MTYzN2E4OWE2MTNhMDUzOGFiMWY1Mzg1MmNkNWUyNWQyNjlhYjE0
15
- M2NmYjY2ZDg3MzAxOTNkZTZmZTQ0NDFlY2FmODVjOWI1OTEyYzA=
13
+ MmQ2ZmUxZDViNWE4MjIyNmIzYzY0ODMwN2ZkNTBjYTFkOGFmOWVjNjAzZGVj
14
+ NjFiMDlhZTdhNTA2Yzg3NDJhZjhmZjY1ZTA1YWNkY2IzNDQ0YmZkNzlhZDZj
15
+ Y2YzZDQyZDM3ZDFkOGJmOGEyOTYzZWJlMzUwYTFlYTYzNGZiZWI=
data/lib/url_scrubber.rb CHANGED
@@ -20,7 +20,7 @@ module UrlScrubber
20
20
  url.sub!('#!/', '')
21
21
  url.sub!('%27', '\'')
22
22
  url = downcase_domain(url)
23
- remove_www!(url)
23
+ remove_subdomain!(url)
24
24
  remove_html_tags!(url)
25
25
  url = drop_anchor!(special_cases(url))
26
26
  url.sub!(/,+$/, "") # remove one or more trailing commas at the end of the URL
@@ -200,11 +200,13 @@ module UrlScrubber
200
200
  end
201
201
 
202
202
 
203
- def self.remove_www!(url)
203
+ def self.remove_subdomain!(url)
204
204
  # url.sub!(%r{://www\d*\.}, '://')
205
205
  url.sub!(%r{^https?://www?w?\d*\.}i, 'http://')
206
206
  url.sub!(%r{^https?://m\d*\.}i, 'http://')
207
207
  url.sub!(%r{^https?://mobile\d*\.}i, 'http://')
208
+ url.sub!(%r{^https?://touch\d*\.}i, 'http://')
209
+ url.sub!(%r{^https?://mbasic\.facebook\.com}i, 'http://facebook.com')
208
210
  url
209
211
  end
210
212
 
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.8.6"
2
+ VERSION = "0.8.7"
3
3
  end
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.8.6
4
+ version: 0.8.7
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: 2016-12-10 00:00:00.000000000 Z
14
+ date: 2016-12-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec