richurls 0.5.2 → 0.5.3

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: 490075ea6a2e9a699998b0c01482e173f9d31db067885165943fc3257ddbfe90
4
- data.tar.gz: 8a79f58d979835f17a73ad51520e81845be699e5737367a297f439e6341a8bb0
3
+ metadata.gz: f8022d5e37dee37aa4e7a47b1cecd65075bcb88cce334109ed7df216f2f7971f
4
+ data.tar.gz: 3630be60335862908a877de2c9c751febb103a53c1e57517e64f309ff2e11f11
5
5
  SHA512:
6
- metadata.gz: 900a48b5f28c16049b60b3d6d84ed644458e5df55ef1de2f55a096ae1fea8714ba1f2e29e34f7d7fa9db8d61c8ca544ea0524a5f73c9f8d8e14cef7a5a69170e
7
- data.tar.gz: 7923a8c1bd74250099747aa108595547693b414192aac64b330cb4ae555f40e4cea9f359d42e5f8061785a7f1e5e3d9ee72245c58548b8cde715403bf53db43b
6
+ metadata.gz: 7f1f87d3f68b20d44f8303f4922f196e1acfc7a84954880de3b4abdee4b0a669edc33913accc9bcf61bf680c9992f347f1de6fbbc407837dfaf91c0df95532e2
7
+ data.tar.gz: 7bd2d865aeab876e83f7100039ebfd38d3e14d06dbcb11bdcdeeb0111703ec6ea91858006e085834aa5c6312138ff620d45ee7615df79e99501b498a526a4f9c
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- richurls (0.5.2)
4
+ richurls (0.5.3)
5
+ addressable (~> 2)
5
6
  oj (~> 3)
6
7
  ox (~> 2)
7
8
  patron (~> 0.13)
@@ -9,6 +10,8 @@ PATH
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
12
15
  ast (2.4.0)
13
16
  diff-lcs (1.3)
14
17
  jaro_winkler (1.5.4)
@@ -18,6 +21,7 @@ GEM
18
21
  parser (2.7.0.5)
19
22
  ast (~> 2.4.0)
20
23
  patron (0.13.3)
24
+ public_suffix (4.0.4)
21
25
  rainbow (3.0.0)
22
26
  redis (4.1.3)
23
27
  rexml (3.2.4)
data/lib/url_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'addressable'
2
+
1
3
  module UrlHelper
2
4
  def self.url_for(domain, url)
3
5
  return if url.nil?
@@ -5,11 +7,12 @@ module UrlHelper
5
7
 
6
8
  domain_uri = URI(domain)
7
9
  base = domain_uri.scheme + '://' + domain_uri.host
10
+ escaped_url = Addressable::URI.escape(url)
8
11
 
9
12
  if url.start_with?('/')
10
- base + url
13
+ base + escaped_url
11
14
  else
12
- base + domain_uri.path + '/' + url
15
+ base + domain_uri.path + '/' + escaped_url
13
16
  end
14
17
  end
15
18
 
data/richurls.gemspec CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'richurls'
6
- spec.version = '0.5.2'
6
+ spec.version = '0.5.3'
7
7
  spec.authors = ['grdw']
8
8
  spec.email = ['gerard@wetransfer.com']
9
9
 
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
+ spec.add_dependency 'addressable', '~> 2'
31
32
  spec.add_dependency 'oj', '~> 3'
32
33
  spec.add_dependency 'ox', '~> 2'
33
34
  spec.add_dependency 'patron', '~> 0.13'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richurls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: addressable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: oj
15
29
  requirement: !ruby/object:Gem::Requirement