alexrabarts-tld 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.rdoc +7 -7
- data/VERSION.yml +1 -1
- data/lib/tld/tld.rb +4 -0
- data/test/tld_test.rb +9 -0
- data/tld.gemspec +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -7,6 +7,8 @@ descriptive name, associated currency code and the TLD category.
|
|
7
7
|
|
8
8
|
== SYNOPSIS:
|
9
9
|
|
10
|
+
require 'tld'
|
11
|
+
|
10
12
|
# Find a descriptive name
|
11
13
|
TLD.find('au').name # => "Australia"
|
12
14
|
TLD.find('biz').name # => "Business"
|
@@ -26,19 +28,17 @@ descriptive name, associated currency code and the TLD category.
|
|
26
28
|
TLD.find('foo.com.au').name # => "Australia"
|
27
29
|
TLD.find('http://foo.com.au/bar').name # => "Australia"
|
28
30
|
|
31
|
+
# Check if a TLD is valid
|
32
|
+
TLD.valid?('au') # => true
|
33
|
+
TLD.valid?('foo') # => false
|
34
|
+
|
29
35
|
== REQUIREMENTS:
|
30
36
|
|
31
37
|
iso_country_codes gem (see http://github.com/alexrabarts/iso_country_codes)
|
32
38
|
|
33
39
|
== INSTALL:
|
34
40
|
|
35
|
-
|
36
|
-
|
37
|
-
git clone git://github.com/alexrabarts/tld.git
|
38
|
-
|
39
|
-
* Via gem:
|
40
|
-
|
41
|
-
gem install alexrabarts-tld -s http://gems.github.com
|
41
|
+
gem install alexrabarts-tld -s http://gems.github.com
|
42
42
|
|
43
43
|
== LICENSE:
|
44
44
|
|
data/VERSION.yml
CHANGED
data/lib/tld/tld.rb
CHANGED
data/test/tld_test.rb
CHANGED
@@ -59,4 +59,13 @@ class TestTld < Test::Unit::TestCase
|
|
59
59
|
TLD.find('foo')
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
should 'confirm that TLD is valid' do
|
64
|
+
assert TLD.valid?('au')
|
65
|
+
assert TLD.valid?('AU')
|
66
|
+
end
|
67
|
+
|
68
|
+
should 'confirm that TLD is invalid' do
|
69
|
+
assert_equal false, TLD.valid?('not-a-tld')
|
70
|
+
end
|
62
71
|
end
|
data/tld.gemspec
CHANGED