adomain 0.2.1 → 0.2.2
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/README.md +3 -0
- data/lib/adomain.rb +8 -0
- data/lib/adomain/version.rb +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: 56b3fbe678e72450decc15bfc4d04a35b92765c5f89047d6c409a90df290ba07
|
4
|
+
data.tar.gz: d9ee244d9c2741445492ce2a1abbbb8fdf9e09182850ea0788c167a14f3b843a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd61d9cf052e21c113d337f4baa192d6397fb27ea1db83edd353166dd0bcc277acde381a31e177f1f2de732d2a1f1eea646d3ddd562d1aa6300c453c7a06ac26
|
7
|
+
data.tar.gz: 41517c82d6996b6f68bcb1491d4232aa24d95c2fd6f405996e4e75270e927fd14399a51e81cad6d679afd808124f07be9114c6b6a986c269405d0d64e14d7d11
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -88,6 +88,8 @@ Adomain.path "http://www.xyz.com/pages/123" # => "/pages/123"
|
|
88
88
|
Adomain.path "{{{{{" # => "{{{{{"
|
89
89
|
Adomain.scheme "http://www.xyz.com/pages/123" # => "http"
|
90
90
|
Adomain.scheme "harrison:ford" # => "harrison"
|
91
|
+
Adomain.query_values "https://maximumfun.org/donate?amt=20USD" # => {"amt"=>"20USD"}
|
92
|
+
Adomain.query_values "google.com?q=gagh.biz" # => {"q"=>"gagh.biz"}
|
91
93
|
```
|
92
94
|
|
93
95
|
However, they are rescued from InvalidURIError,
|
@@ -96,6 +98,7 @@ like in other parts of the gem.
|
|
96
98
|
```ruby
|
97
99
|
Adomain.path "::::::::::::" #=> nil
|
98
100
|
Adomain.scheme "::::::::::::" #=> nil
|
101
|
+
Adomain.query_values "::::::::::::" #=> nil
|
99
102
|
```
|
100
103
|
|
101
104
|
## Installation
|
data/lib/adomain.rb
CHANGED
@@ -57,6 +57,14 @@ class Adomain
|
|
57
57
|
nil
|
58
58
|
end
|
59
59
|
|
60
|
+
# query_values is a wrapper around Addressable::URI's query_values
|
61
|
+
# it is only included for convenience
|
62
|
+
def query_values(string)
|
63
|
+
Addressable::URI.parse(string).query_values
|
64
|
+
rescue Addressable::URI::InvalidURIError => e
|
65
|
+
nil
|
66
|
+
end
|
67
|
+
|
60
68
|
private
|
61
69
|
# parse_for_domain accepts one hash of arguments that allow
|
62
70
|
# changes to the parsing behavior of domains
|
data/lib/adomain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adomain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Nissen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|