url_scrubber 0.8.19 → 0.8.23

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
  SHA256:
3
- metadata.gz: 0680a828726042be2766612efd11c43758ba9a0f023e170df4e2a15453d65093
4
- data.tar.gz: cb51233dee027755a47d0685d1ddaed6603973fc3e60a611de999362139cc779
3
+ metadata.gz: 4558673ef07349f4ae8fd577edfcf3b005ce6be12f022a6d52d008aacfd7cabd
4
+ data.tar.gz: a0d715b3ec092791f73da84c9658ce030e1c71164e780b198c995bd7b04838fa
5
5
  SHA512:
6
- metadata.gz: 346585dbf48da33a2d322dfc0aac6b5d2f1fc1dd3a6046b9983b343b2cc86d42294247cbac672336fac20a9bb75ed54b691b844b0f80e06e5ecf6a48bd090db4
7
- data.tar.gz: 98af0d3bd7c1abb443a26124e65f847f2c1a64be8eb732d365acc252ea20bf7bc873598b9f64f4e3a01b96ee72baec8f9b270f3128c3ef1179e11b9628e39bb5
6
+ metadata.gz: 6345f6aba2066b3d5a31f9b2be28f0fd84ccf9268c3782000a51a35495c99c970a458933503b699b237e909d879b00501bbf6cba3ed2be5f87570278de6e9f56
7
+ data.tar.gz: 59e7fcb1077c9a5488b03553ea2df050ff063c1f10d83bffeb094d04b4d6fea3dcaed3ab3de426b0732590827ac3f3219d90c1dfd9ebd07dfbb000f740c79444
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.8.19"
2
+ VERSION = "0.8.23"
3
3
  end
data/lib/url_scrubber.rb CHANGED
@@ -9,10 +9,11 @@ module UrlScrubber
9
9
  def self.scrub(url)
10
10
  return url if url.blank?
11
11
  return url if /^app:\/\//.match(url) # Do not scrub app-only URLs
12
+ return url if /^https?:\/\/(www.)?business.tiktok\.com\/manage\//.match(url) # Don't scrub tik tok business manager urls, quick fix until we can implement a different solution, https://business.tiktok.com/manage/overview?org_id=6974497704617492482
12
13
 
13
14
  url = url.clone # don't modify the original argument
14
15
 
15
- m = url.match(/(htt?ps?:\/\/\S*)/i)
16
+ m = url.match(/(htt?ps?:\/\/\S+)/i)
16
17
  return nil unless m
17
18
 
18
19
  url = m[1]
@@ -119,9 +120,11 @@ module UrlScrubber
119
120
  return url.include?('http://linkedin.com/in/') || url.include?('http://linkedin.com/pub/')
120
121
  end
121
122
 
122
-
123
+
123
124
  def self.find_identity_from_url(url)
124
- UrlScrubber.scrub(url).split("/").last unless url.nil?
125
+ return nil unless url.present?
126
+ url = UrlScrubber.scrub(url)
127
+ url ? url.split("/").last : nil
125
128
  end
126
129
 
127
130
 
@@ -179,7 +182,11 @@ module UrlScrubber
179
182
 
180
183
  def self.downcase_domain(url)
181
184
  domain_match = url.match(%r{http://[^/]+}i)
182
- domain_match[0].downcase + domain_match.post_match
185
+ if domain_match
186
+ domain_match[0].downcase + domain_match.post_match
187
+ else
188
+ url
189
+ end
183
190
  end
184
191
 
185
192
 
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.19
4
+ version: 0.8.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Langton
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2019-04-05 00:00:00.000000000 Z
15
+ date: 2021-09-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.7.8
128
+ rubygems_version: 3.0.6
130
129
  signing_key:
131
130
  specification_version: 4
132
131
  summary: Clean up URLs.