richurls 0.5.4 → 0.5.5

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: 5198667f5f8b0ab26bfb13bd20f7631e59242abeced6b244f63f275626162ee6
4
- data.tar.gz: 5faf0205ed0a278f9fe2bbcc4d0cf3d2cfccf3916fee2546c21fcb5ae4661462
3
+ metadata.gz: 693d986c664aa571150f5c426a7ee496125e615321c1156d2c0eaf0b3f0db6e7
4
+ data.tar.gz: 4699ba24e5a8f2ed3ccfd2e8aa632c4243033e72d0f6db5b54e5faa16313514d
5
5
  SHA512:
6
- metadata.gz: 5a693158c7276651a01899ce1db0eb0f32bbe97d16812f3fa6fe9bbd76b70314838259c45ccafa2a2b0ce041cd29f5c34d2249206b345cace3fa3f7968c39897
7
- data.tar.gz: 5087bbc294f8adc06c563d8763fc9db3d6db529b77cedd99e7cb784641e265492db431906d67af84fdcd503858b1593a9d584c1f9ffbbd0ed91eb92c55afa4de
6
+ metadata.gz: b5d7b35375f42c0bdfecdbd05179c984c1ec0d05669c3067280bbcea38bf9f9a34e79794ce587d4f23d0b26dfd1f45a664a6575551eccea7038bd89f3a168eb1
7
+ data.tar.gz: 04c2167a8ee0dad5a80447522a96d188a9687771e49609bf0857aa0d223fb47659a73de66225b376ce23000271f8dbb7546f48e72cc3ace62a1aa1fd6e130b92
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- richurls (0.5.4)
4
+ richurls (0.5.5)
5
5
  addressable (~> 2)
6
6
  oj (~> 3)
7
7
  ox (~> 2)
data/lib/url_helper.rb CHANGED
@@ -17,8 +17,14 @@ class UrlHelper
17
17
 
18
18
  def url
19
19
  return if @url.nil?
20
- return @url if valid_url?
20
+ return Addressable::URI.escape(@url) if valid_url?
21
21
 
22
+ build_url
23
+ end
24
+
25
+ private
26
+
27
+ def build_url
22
28
  domain_uri = URI(@domain)
23
29
  base = domain_uri.scheme + '://' + domain_uri.host
24
30
  escaped_url = Addressable::URI.escape(@url)
@@ -30,8 +36,6 @@ class UrlHelper
30
36
  end
31
37
  end
32
38
 
33
- private
34
-
35
39
  def valid_url?
36
40
  @url.start_with?('//') || @url =~ URI::DEFAULT_PARSER.make_regexp
37
41
  end
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.4'
6
+ spec.version = '0.5.5'
7
7
  spec.authors = ['grdw']
8
8
  spec.email = ['gerard@wetransfer.com']
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richurls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable