ryodo 0.2.2 → 0.2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +3 -7
- data/Gemfile +2 -12
- data/Gemfile.lock +25 -29
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +10 -10
- data/Rakefile +32 -14
- data/checks/matching.rb +2 -2
- data/data/suffix.dat +1944 -125
- data/lib/ryodo/convenience/utf8.rb +2 -2
- data/lib/ryodo/convenience.rb +2 -2
- data/lib/ryodo/domain.rb +2 -2
- data/lib/ryodo/ext/string.rb +1 -1
- data/lib/ryodo/ext/uri.rb +2 -2
- data/lib/ryodo/methods.rb +2 -2
- data/lib/ryodo/parser.rb +2 -2
- data/lib/ryodo/rule.rb +2 -2
- data/lib/ryodo/rule_set.rb +6 -12
- data/lib/ryodo/suffix_list.rb +2 -2
- data/lib/ryodo/suffix_list_fetcher.rb +2 -2
- data/lib/ryodo/version.rb +3 -0
- data/lib/ryodo.rb +5 -9
- data/ryodo.gemspec +23 -85
- data/spec/_files/mozilla_effective_tld_names.dat +2104 -272
- data/spec/ryodo/suffix_list_fetcher_spec.rb +3 -4
- data/spec/ryodo/suffix_list_spec.rb +2 -2
- data/spec/ryodo_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -3
- metadata +35 -66
- data/.document +0 -5
- data/.rbenv-gemsets +0 -1
- data/.rbenv-version +0 -1
- data/.ruby-version +0 -1
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f46d8b24a8bd695cfc6f4841d3825be3a4cb417c
|
4
|
+
data.tar.gz: da363e80c452085a77d24b04bb06a70762477965
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 761feba4fc480e250399ad83cc43497d843e6549b7edf42c374a3920b1d7b21446ea82ea203300b0a63c17ede36d2c86cc32ae6c48dbd749ef337fa2b19c3928
|
7
|
+
data.tar.gz: 8e87dda60e727d9e6bb0d001d14444e01854ff54399ed34eb70acf5239a5caf9ba57dd17dd5552402123eb21329c1420d0dc2cf13bc13022b9e0f818bdb4277a
|
data/.gitignore
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,46 +1,42 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ryodo (0.2.4.1)
|
5
|
+
|
1
6
|
GEM
|
2
|
-
remote:
|
7
|
+
remote: https://rubygems.org/
|
3
8
|
specs:
|
4
|
-
coderay (1.0.
|
9
|
+
coderay (1.0.8)
|
5
10
|
diff-lcs (1.1.3)
|
6
11
|
fakeweb (1.3.0)
|
7
|
-
|
8
|
-
|
9
|
-
bundler (~> 1.0)
|
10
|
-
git (>= 1.2.5)
|
11
|
-
rake
|
12
|
-
rdoc
|
13
|
-
json (1.7.3)
|
14
|
-
method_source (0.7.1)
|
15
|
-
pry (0.9.9.6)
|
12
|
+
method_source (0.8.1)
|
13
|
+
pry (0.9.11.4)
|
16
14
|
coderay (~> 1.0.5)
|
17
|
-
method_source (~> 0.
|
18
|
-
slop (
|
19
|
-
pry-doc (0.4.
|
20
|
-
pry (>= 0.9.
|
15
|
+
method_source (~> 0.8)
|
16
|
+
slop (~> 3.4)
|
17
|
+
pry-doc (0.4.4)
|
18
|
+
pry (>= 0.9.9.6)
|
21
19
|
yard (~> 0.8.1)
|
22
|
-
rake (0.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
rspec-
|
27
|
-
|
28
|
-
|
29
|
-
rspec-core (2.10.1)
|
30
|
-
rspec-expectations (2.10.0)
|
20
|
+
rake (10.0.3)
|
21
|
+
rspec (2.12.0)
|
22
|
+
rspec-core (~> 2.12.0)
|
23
|
+
rspec-expectations (~> 2.12.0)
|
24
|
+
rspec-mocks (~> 2.12.0)
|
25
|
+
rspec-core (2.12.2)
|
26
|
+
rspec-expectations (2.12.1)
|
31
27
|
diff-lcs (~> 1.1.3)
|
32
|
-
rspec-mocks (2.
|
33
|
-
slop (
|
34
|
-
yard (0.8.
|
28
|
+
rspec-mocks (2.12.2)
|
29
|
+
slop (3.4.3)
|
30
|
+
yard (0.8.3)
|
35
31
|
|
36
32
|
PLATFORMS
|
37
33
|
ruby
|
38
34
|
|
39
35
|
DEPENDENCIES
|
40
|
-
bundler
|
36
|
+
bundler (~> 1.3)
|
41
37
|
fakeweb
|
42
|
-
jeweler
|
43
38
|
pry
|
44
39
|
pry-doc
|
45
40
|
rake
|
46
41
|
rspec
|
42
|
+
ryodo!
|
data/{LICENSE.txt → LICENSE}
RENAMED
data/README.md
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
**ryōdo【領土】 りょうど — A domain name parser using public suffix list**
|
4
4
|
|
5
|
-
|
5
|
+
Do you ever wanted to know if `suspicious.domain.name.blerp` is really a valid domain?
|
6
6
|
|
7
|
-
|
7
|
+
Do you ever wanted to know what is the domain portion of `others.guy.awesome.domain.co.jp`?
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
**Works only with Ruby 1.9.x!** (I dropped all support for 1.8.x)
|
9
|
+
Then you should try `ryodo` and get the answers!
|
12
10
|
|
11
|
+
Notice: This gem **does not** check DNS records to verify if a name was taken and registered, this is not its purpose.
|
12
|
+
I am a big fan of the UNIX philosophy: *»Write programs that do one thing and do it well.«*
|
13
13
|
|
14
14
|
|
15
15
|
## Usage
|
@@ -53,14 +53,14 @@ ryodo("my.awesome.domain.co.jp")
|
|
53
53
|
```
|
54
54
|
|
55
55
|
|
56
|
-
### Quick check (.
|
56
|
+
### Quick check (.domain_valid?)
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
Ryodo.domain_valid?("my.awesome.domain.co.jp") #=> true
|
60
60
|
Ryodo.domain_valid?("co.jp") #=> false
|
61
61
|
|
62
62
|
# aliases
|
63
|
-
Ryodo.
|
63
|
+
Ryodo.valid_domain?("my.awesome.domain.co.jp")
|
64
64
|
Ryodo.valid?("my.awesome.domain.co.jp")
|
65
65
|
Ryodo?("my.awesome.domain.co.jp")
|
66
66
|
ryodo?("my.awesome.domain.co.jp")
|
@@ -90,7 +90,7 @@ gem "ryodo", :require => ["ryodo", "ryodo/ext/string"]
|
|
90
90
|
### UTF-8 junkie?
|
91
91
|
|
92
92
|
```ruby
|
93
|
-
#
|
93
|
+
# coding: utf-8
|
94
94
|
require "ryodo/convenience/utf8"
|
95
95
|
|
96
96
|
ryōdo("my.awesome.domain.co.jp")
|
@@ -223,6 +223,6 @@ Lot of specs missing, this first version of second approach was developed in pla
|
|
223
223
|
|
224
224
|
## License
|
225
225
|
|
226
|
-
MIT/X11 — see `LICENSE
|
226
|
+
MIT/X11 — see [`LICENSE`](./LICENSE)
|
227
227
|
|
228
|
-
(c) 2012 Christoph Grabo
|
228
|
+
(c) 2012—2013 Christoph Grabo
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
|
3
3
|
require "rubygems"
|
4
4
|
require "bundler"
|
@@ -10,22 +10,9 @@ rescue Bundler::BundlerError => e
|
|
10
10
|
exit e.status_code
|
11
11
|
end
|
12
12
|
require "rake"
|
13
|
-
require "jeweler"
|
14
13
|
require "rspec"
|
15
14
|
require "rspec/core/rake_task"
|
16
15
|
|
17
|
-
Jeweler::Tasks.new do |gem|
|
18
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
19
|
-
gem.name = "ryodo"
|
20
|
-
gem.homepage = "http://github.com/asaaki/ryodo"
|
21
|
-
gem.license = "MIT"
|
22
|
-
gem.summary = %Q{ryōdo【領土】 りょうど — A domain name parser using public suffix list}
|
23
|
-
gem.description = %Q{ryōdo【領土】 りょうど — A domain name parser gem using public suffix list (provided by publicsuffix.org/mozilla)}
|
24
|
-
gem.email = "chris@dinarrr.com"
|
25
|
-
gem.authors = ["Christoph Grabo"]
|
26
|
-
# dependencies defined in Gemfile
|
27
|
-
end
|
28
|
-
Jeweler::RubygemsDotOrgTasks.new
|
29
16
|
|
30
17
|
desc "Starts IRB with gem loaded"
|
31
18
|
task :irb do
|
@@ -37,17 +24,48 @@ task :pry do
|
|
37
24
|
sh "pry -I lib -r ryodo --no-pager"
|
38
25
|
end
|
39
26
|
|
27
|
+
|
40
28
|
desc "Run all specs"
|
41
29
|
task RSpec::Core::RakeTask.new(:spec) do |t|
|
42
30
|
t.pattern = 'spec/**/*_spec.rb'
|
43
31
|
t.verbose = false
|
44
32
|
end
|
45
33
|
|
34
|
+
|
46
35
|
desc "Fetch and save public suffix data (task for updates)"
|
47
36
|
task :fetch_data do
|
37
|
+
$: << "lib"
|
48
38
|
require "ryodo"
|
49
39
|
require "ryodo/suffix_list_fetcher"
|
50
40
|
Ryodo::SuffixListFetcher.fetch_and_save!
|
51
41
|
end
|
52
42
|
|
43
|
+
|
44
|
+
namespace :gem do
|
45
|
+
$: << "lib"
|
46
|
+
require "ryodo/version"
|
47
|
+
|
48
|
+
task :tag do
|
49
|
+
system "git tag -f v#{Ryodo::VERSION} && git push --tags -f"
|
50
|
+
end
|
51
|
+
|
52
|
+
task :build do
|
53
|
+
system "rm *.gem"
|
54
|
+
system "gem build ryodo.gemspec"
|
55
|
+
end
|
56
|
+
|
57
|
+
task :push => "gem:build" do
|
58
|
+
system "gem push ryodo-#{Ryodo::VERSION}.gem"
|
59
|
+
end
|
60
|
+
|
61
|
+
task :clean do
|
62
|
+
system "rm *.gem"
|
63
|
+
end
|
64
|
+
|
65
|
+
desc "Publish gem to rubygems.org"
|
66
|
+
task :publish => ["gem:tag","gem:push","gem:clean"]
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
|
53
71
|
task :default => :spec
|
data/checks/matching.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# coding: utf-8
|
3
3
|
$: << "lib"
|
4
4
|
require "ryodo"
|
5
5
|
|
@@ -89,4 +89,4 @@ checkPublicSuffix('test.ak.us', 'test.ak.us')
|
|
89
89
|
checkPublicSuffix('www.test.ak.us', 'test.ak.us')
|
90
90
|
checkPublicSuffix('k12.ak.us', 'NULL')
|
91
91
|
checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us')
|
92
|
-
checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us')
|
92
|
+
checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us')
|