domainatrix 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -0
- data/lib/domainatrix.rb +1 -1
- data/lib/domainatrix/domain_parser.rb +1 -1
- data/lib/domainatrix/url.rb +2 -1
- data/spec/domainatrix/domain_parser_spec.rb +2 -2
- data/spec/domainatrix/url_spec.rb +4 -0
- metadata +1 -1
data/README.textile
CHANGED
data/lib/domainatrix.rb
CHANGED
data/lib/domainatrix/url.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Domainatrix
|
2
2
|
class Url
|
3
|
-
attr_reader :tld, :domain, :subdomain, :path
|
3
|
+
attr_reader :tld, :domain, :subdomain, :path, :url
|
4
4
|
|
5
5
|
def initialize(attrs = {})
|
6
|
+
@url = attrs[:url]
|
6
7
|
@tld = attrs[:tld]
|
7
8
|
@domain = attrs[:domain]
|
8
9
|
@subdomain = attrs[:subdomain]
|
@@ -29,8 +29,8 @@ describe "domain parser" do
|
|
29
29
|
@domain_parser.parse("http://pauldix.net").should be_a Hash
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
33
|
-
@domain_parser.parse("http://pauldix.net").
|
32
|
+
it "includes the original url" do
|
33
|
+
@domain_parser.parse("http://www.pauldix.net")[:url].should == "http://www.pauldix.net"
|
34
34
|
end
|
35
35
|
|
36
36
|
it "parses out the path" do
|
@@ -1,6 +1,10 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
3
|
describe "url" do
|
4
|
+
it "has the original url" do
|
5
|
+
Domainatrix::Url.new(:url => "http://pauldix.net").url.should == "http://pauldix.net"
|
6
|
+
end
|
7
|
+
|
4
8
|
it "has the tld" do
|
5
9
|
Domainatrix::Url.new(:tld => "net").tld.should == "net"
|
6
10
|
end
|