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
data/lib/ryodo/convenience.rb
CHANGED
data/lib/ryodo/domain.rb
CHANGED
data/lib/ryodo/ext/string.rb
CHANGED
data/lib/ryodo/ext/uri.rb
CHANGED
data/lib/ryodo/methods.rb
CHANGED
data/lib/ryodo/parser.rb
CHANGED
data/lib/ryodo/rule.rb
CHANGED
data/lib/ryodo/rule_set.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
|
3
3
|
module Ryodo
|
4
4
|
class RuleSet
|
@@ -35,18 +35,12 @@ module Ryodo
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def select_rule(rule_path)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if path.empty?
|
43
|
-
@tree[current]
|
44
|
-
|
38
|
+
if rule_path[-1]
|
39
|
+
if rule_path[0..-2].empty?
|
40
|
+
@tree[rule_path[-1]]
|
45
41
|
else
|
46
|
-
rule = select_rule(
|
47
|
-
rule.children[current] if rule
|
42
|
+
rule = select_rule(rule_path[0..-2]) and rule.children[rule_path[-1]]
|
48
43
|
end
|
49
|
-
|
50
44
|
end
|
51
45
|
end
|
52
46
|
|
@@ -69,4 +63,4 @@ module Ryodo
|
|
69
63
|
end
|
70
64
|
|
71
65
|
end
|
72
|
-
end
|
66
|
+
end
|
data/lib/ryodo/suffix_list.rb
CHANGED
data/lib/ryodo.rb
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
|
3
3
|
module Ryodo
|
4
|
-
|
5
|
-
VERSION_FILE = File.expand_path("../../VERSION", __FILE__)
|
6
|
-
VERSION = File.exist?(VERSION_FILE) ? File.read(VERSION_FILE) : "(could not find VERSION file)"
|
7
|
-
|
8
|
-
RYODO_ROOT = File.expand_path("../..", __FILE__)
|
9
|
-
|
4
|
+
RYODO_ROOT = File.expand_path("../..", __FILE__)
|
10
5
|
PUBLIC_SUFFIX_DATA_URI = "http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1"
|
11
6
|
PUBLIC_SUFFIX_STORE = "#{RYODO_ROOT}/data/suffix.dat"
|
12
|
-
|
13
7
|
end
|
14
8
|
|
9
|
+
require "ryodo/version"
|
10
|
+
|
15
11
|
require "ryodo/domain"
|
16
12
|
require "ryodo/parser"
|
17
13
|
require "ryodo/rule"
|
@@ -27,4 +23,4 @@ module Ryodo
|
|
27
23
|
extend Ryodo::Methods
|
28
24
|
require "ryodo/convenience"
|
29
25
|
end
|
30
|
-
#require "ryodo/convenience/utf8"
|
26
|
+
#require "ryodo/convenience/utf8"
|
data/ryodo.gemspec
CHANGED
@@ -1,89 +1,27 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "ryodo/version"
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ryodo"
|
8
|
+
spec.version = Ryodo::VERSION
|
9
|
+
spec.authors = ["Christoph Grabo"]
|
10
|
+
spec.email = ["chris@dinarrr.com"]
|
11
|
+
spec.description = %q{ryōdo【領土】 りょうど — A domain name parser gem using public suffix list (provided by publicsuffix.org/mozilla)}
|
12
|
+
spec.summary = %q{ryōdo【領土】 りょうど — A domain name parser using public suffix list}
|
13
|
+
spec.homepage = "http://github.com/asaaki/ryodo"
|
14
|
+
spec.license = "MIT"
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.email = "chris@dinarrr.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rbenv-gemsets",
|
22
|
-
".rbenv-version",
|
23
|
-
".rspec",
|
24
|
-
".ruby-version",
|
25
|
-
".travis.yml",
|
26
|
-
"Gemfile",
|
27
|
-
"Gemfile.lock",
|
28
|
-
"LICENSE.txt",
|
29
|
-
"README.md",
|
30
|
-
"Rakefile",
|
31
|
-
"VERSION",
|
32
|
-
"checks/matching.rb",
|
33
|
-
"data/suffix.dat",
|
34
|
-
"lib/ryodo.rb",
|
35
|
-
"lib/ryodo/convenience.rb",
|
36
|
-
"lib/ryodo/convenience/utf8.rb",
|
37
|
-
"lib/ryodo/domain.rb",
|
38
|
-
"lib/ryodo/ext/string.rb",
|
39
|
-
"lib/ryodo/ext/uri.rb",
|
40
|
-
"lib/ryodo/methods.rb",
|
41
|
-
"lib/ryodo/parser.rb",
|
42
|
-
"lib/ryodo/rule.rb",
|
43
|
-
"lib/ryodo/rule_set.rb",
|
44
|
-
"lib/ryodo/suffix_list.rb",
|
45
|
-
"lib/ryodo/suffix_list_fetcher.rb",
|
46
|
-
"ryodo.gemspec",
|
47
|
-
"spec/_files/mozilla_effective_tld_names.dat",
|
48
|
-
"spec/ryodo/suffix_list_fetcher_spec.rb",
|
49
|
-
"spec/ryodo/suffix_list_spec.rb",
|
50
|
-
"spec/ryodo_spec.rb",
|
51
|
-
"spec/spec_helper.rb"
|
52
|
-
]
|
53
|
-
s.homepage = "http://github.com/asaaki/ryodo"
|
54
|
-
s.licenses = ["MIT"]
|
55
|
-
s.require_paths = ["lib"]
|
56
|
-
s.rubygems_version = "1.8.23"
|
57
|
-
s.summary = "ry\u{14d}do\u{3010}\u{9818}\u{571f}\u{3011} \u{308a}\u{3087}\u{3046}\u{3069} \u{2014} A domain name parser using public suffix list"
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = []
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
58
20
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
66
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
67
|
-
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
68
|
-
s.add_development_dependency(%q<pry>, [">= 0"])
|
69
|
-
s.add_development_dependency(%q<pry-doc>, [">= 0"])
|
70
|
-
else
|
71
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
72
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
73
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
74
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
75
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
76
|
-
s.add_dependency(%q<pry>, [">= 0"])
|
77
|
-
s.add_dependency(%q<pry-doc>, [">= 0"])
|
78
|
-
end
|
79
|
-
else
|
80
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
81
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
82
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
83
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
84
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
85
|
-
s.add_dependency(%q<pry>, [">= 0"])
|
86
|
-
s.add_dependency(%q<pry-doc>, [">= 0"])
|
87
|
-
end
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "fakeweb"
|
25
|
+
spec.add_development_dependency "pry"
|
26
|
+
spec.add_development_dependency "pry-doc"
|
88
27
|
end
|
89
|
-
|