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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/url_helper.rb +7 -3
- data/richurls.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 693d986c664aa571150f5c426a7ee496125e615321c1156d2c0eaf0b3f0db6e7
|
4
|
+
data.tar.gz: 4699ba24e5a8f2ed3ccfd2e8aa632c4243033e72d0f6db5b54e5faa16313514d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d7b35375f42c0bdfecdbd05179c984c1ec0d05669c3067280bbcea38bf9f9a34e79794ce587d4f23d0b26dfd1f45a664a6575551eccea7038bd89f3a168eb1
|
7
|
+
data.tar.gz: 04c2167a8ee0dad5a80447522a96d188a9687771e49609bf0857aa0d223fb47659a73de66225b376ce23000271f8dbb7546f48e72cc3ace62a1aa1fd6e130b92
|
data/Gemfile.lock
CHANGED
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
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
|
+
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-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|