qasa-url 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/qasa/url/version.rb +1 -1
- data/lib/url.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e637380f87112da94c4baabe3f72d117175fcf151978501057034cddee03bd
|
4
|
+
data.tar.gz: e93986b23ed44518830a92af7ce6c7da5c7c096bf4a0f3de30b70dbf696e79d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edfaad59c0df751e0b3da3420322d5d9b7be56bb0cc68b095b58fd22ade71af2ce0edfe34c351412d2ccaf640535de5bcb2c0036413c05bb8979384f438cd876
|
7
|
+
data.tar.gz: b5b65f227aad9869a2c7430a90b52743b54c06ff9aeb73ad60aa2043ede1b9c4155655c8b6f6684802387fb16c919256cac4439b4f3666d3f0bc298413713190
|
data/lib/qasa/url/version.rb
CHANGED
data/lib/url.rb
CHANGED
@@ -12,6 +12,7 @@ class URL
|
|
12
12
|
PORT_SEPARATOR = ":"
|
13
13
|
QUERY_STRING_SEPARATOR = "?"
|
14
14
|
SEPARATOR = "://"
|
15
|
+
PROTOCOL_MATCHER = /\A[a-z0-9.+-]*#{Regexp.escape(SEPARATOR)}/io
|
15
16
|
SLASH = "/"
|
16
17
|
SPACE = " "
|
17
18
|
|
@@ -82,8 +83,8 @@ class URL
|
|
82
83
|
private
|
83
84
|
|
84
85
|
def extract_protocol(string)
|
85
|
-
if string.
|
86
|
-
string.split(SEPARATOR)
|
86
|
+
if string.match?(PROTOCOL_MATCHER)
|
87
|
+
string.split(SEPARATOR, 2)
|
87
88
|
else
|
88
89
|
[nil, string]
|
89
90
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qasa-url
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ingemar
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rack
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
rubygems_version: 3.6.
|
69
|
+
rubygems_version: 3.6.9
|
70
70
|
specification_version: 4
|
71
71
|
summary: A simple URL parser and construction tool
|
72
72
|
test_files: []
|