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.
Files changed (2) hide show
  1. data/lib/uri/subdomain.rb +5 -5
  2. 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.1"
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::HTTP.send :include, self
18
+
19
+ URI::Generic.send :include, self
20
20
 
21
21
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-subdomain
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jared