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.
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  module Convenience
@@ -25,4 +25,4 @@ module Ryodo
25
25
  end
26
26
  end
27
27
 
28
- include Ryodo::Convenience::UTF8
28
+ include Ryodo::Convenience::UTF8
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  module Convenience
@@ -14,4 +14,4 @@ module Ryodo
14
14
  end
15
15
  end
16
16
 
17
- include Ryodo::Convenience
17
+ include Ryodo::Convenience
data/lib/ryodo/domain.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  class Domain
@@ -93,4 +93,4 @@ module Ryodo
93
93
  end
94
94
 
95
95
  end
96
- end
96
+ end
@@ -10,4 +10,4 @@ class String
10
10
  Ryodo.domain_valid?(self)
11
11
  end
12
12
 
13
- end
13
+ end
data/lib/ryodo/ext/uri.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
  require "uri"
3
3
 
4
4
  class URI::Generic
@@ -9,4 +9,4 @@ class URI::Generic
9
9
  @host = Ryodo.parse(self.set_host_string(v)) unless self.set_host_string(v).nil?
10
10
  end
11
11
 
12
- end
12
+ end
data/lib/ryodo/methods.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  module Methods
@@ -15,4 +15,4 @@ module Ryodo
15
15
  alias_method :valid?, :domain_valid?
16
16
 
17
17
  end
18
- end
18
+ end
data/lib/ryodo/parser.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  class Parser
@@ -29,4 +29,4 @@ module Ryodo
29
29
  end
30
30
 
31
31
  end
32
- end
32
+ end
data/lib/ryodo/rule.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
  class Rule < Struct.new(:exception, :stopOK, :children)
@@ -12,4 +12,4 @@ module Ryodo
12
12
  end
13
13
 
14
14
  end
15
- end
15
+ end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
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
- path = rule_path.dup
39
-
40
- if current = path.pop
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(path)
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
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  module Ryodo
4
4
 
@@ -54,4 +54,4 @@ module Ryodo
54
54
 
55
55
  end
56
56
 
57
- end
57
+ end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  require "uri"
4
4
  require "net/http"
@@ -51,4 +51,4 @@ module Ryodo
51
51
 
52
52
  end
53
53
 
54
- end
54
+ end
@@ -0,0 +1,3 @@
1
+ module Ryodo
2
+ VERSION = "0.2.4.1"
3
+ end
data/lib/ryodo.rb CHANGED
@@ -1,17 +1,13 @@
1
- # encoding: utf-8
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
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
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 |s|
7
- s.name = "ryodo"
8
- s.version = "0.2.2"
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
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Christoph Grabo"]
12
- s.date = "2012-06-08"
13
- s.description = "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 gem using public suffix list (provided by publicsuffix.org/mozilla)"
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
- if s.respond_to? :specification_version then
60
- s.specification_version = 3
61
-
62
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
- s.add_development_dependency(%q<rake>, [">= 0"])
64
- s.add_development_dependency(%q<bundler>, [">= 0"])
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
-