uri-subdomain 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/uri/subdomain.rb +5 -5
- metadata +3 -3
data/lib/uri/subdomain.rb
CHANGED
@@ -2,20 +2,20 @@ require 'uri'
|
|
2
2
|
|
3
3
|
module URI::Subdomain
|
4
4
|
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.2"
|
6
6
|
|
7
7
|
def domain
|
8
|
-
host.split('.').last(2).join('.')
|
8
|
+
host.split('.').last(2).join('.') if host
|
9
9
|
end
|
10
10
|
|
11
11
|
def subdomain
|
12
|
-
host.split('.').tap(&:pop).tap(&:pop).join('.')
|
12
|
+
host.split('.').tap(&:pop).tap(&:pop).join('.') if host
|
13
13
|
end
|
14
14
|
|
15
15
|
def subdomain= subdomain
|
16
16
|
self.host = "#{subdomain}.#{domain}"
|
17
17
|
end
|
18
|
-
|
19
|
-
URI::
|
18
|
+
|
19
|
+
URI::Generic.send :include, self
|
20
20
|
|
21
21
|
end
|
metadata
CHANGED