public_suffix 2.0.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -0
- data/.rubocop_defaults.yml +54 -15
- data/.travis.yml +6 -3
- data/CHANGELOG.md +18 -9
- data/Gemfile +2 -2
- data/README.md +14 -0
- data/Rakefile +5 -3
- data/bin/console +14 -0
- data/data/list.txt +462 -82
- data/lib/public_suffix.rb +20 -16
- data/lib/public_suffix/list.rb +66 -107
- data/lib/public_suffix/rule.rb +42 -52
- data/lib/public_suffix/version.rb +1 -1
- data/public_suffix.gemspec +1 -1
- data/test/.empty +2 -0
- data/test/acceptance_test.rb +10 -2
- data/test/benchmarks/bm_find.rb +66 -0
- data/test/benchmarks/bm_find_all.rb +102 -0
- data/test/benchmarks/bm_names.rb +91 -0
- data/test/benchmarks/bm_select.rb +26 -0
- data/test/benchmarks/bm_select_incremental.rb +25 -0
- data/test/benchmarks/bm_valid.rb +101 -0
- data/test/profilers/domain_profiler.rb +12 -0
- data/test/profilers/find_profiler.rb +12 -0
- data/test/profilers/find_profiler_jp.rb +12 -0
- data/test/{initialization_profiler.rb → profilers/initialization_profiler.rb} +1 -1
- data/test/profilers/list_profsize.rb +11 -0
- data/test/profilers/object_binsize.rb +57 -0
- data/test/psl_test.rb +1 -1
- data/test/test_helper.rb +0 -8
- data/test/unit/domain_test.rb +15 -15
- data/test/unit/list_test.rb +46 -66
- data/test/unit/public_suffix_test.rb +5 -5
- data/test/unit/rule_test.rb +45 -49
- metadata +30 -12
- data/test/benchmark_helper.rb +0 -4
- data/test/execution_profiler.rb +0 -14
- data/test/performance_benchmark.rb +0 -38
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: public_suffix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simone Carletti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- LICENSE.txt
|
74
74
|
- README.md
|
75
75
|
- Rakefile
|
76
|
+
- bin/console
|
76
77
|
- data/list.txt
|
77
78
|
- lib/public_suffix.rb
|
78
79
|
- lib/public_suffix/domain.rb
|
@@ -81,11 +82,20 @@ files:
|
|
81
82
|
- lib/public_suffix/rule.rb
|
82
83
|
- lib/public_suffix/version.rb
|
83
84
|
- public_suffix.gemspec
|
85
|
+
- test/.empty
|
84
86
|
- test/acceptance_test.rb
|
85
|
-
- test/
|
86
|
-
- test/
|
87
|
-
- test/
|
88
|
-
- test/
|
87
|
+
- test/benchmarks/bm_find.rb
|
88
|
+
- test/benchmarks/bm_find_all.rb
|
89
|
+
- test/benchmarks/bm_names.rb
|
90
|
+
- test/benchmarks/bm_select.rb
|
91
|
+
- test/benchmarks/bm_select_incremental.rb
|
92
|
+
- test/benchmarks/bm_valid.rb
|
93
|
+
- test/profilers/domain_profiler.rb
|
94
|
+
- test/profilers/find_profiler.rb
|
95
|
+
- test/profilers/find_profiler_jp.rb
|
96
|
+
- test/profilers/initialization_profiler.rb
|
97
|
+
- test/profilers/list_profsize.rb
|
98
|
+
- test/profilers/object_binsize.rb
|
89
99
|
- test/psl_test.rb
|
90
100
|
- test/test_helper.rb
|
91
101
|
- test/tests.txt
|
@@ -106,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
116
|
requirements:
|
107
117
|
- - ">="
|
108
118
|
- !ruby/object:Gem::Version
|
109
|
-
version: '2.
|
119
|
+
version: '2.1'
|
110
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
121
|
requirements:
|
112
122
|
- - ">="
|
@@ -114,16 +124,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
124
|
version: '0'
|
115
125
|
requirements: []
|
116
126
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.6.10
|
118
128
|
signing_key:
|
119
129
|
specification_version: 4
|
120
130
|
summary: Domain name parser based on the Public Suffix List.
|
121
131
|
test_files:
|
122
132
|
- test/acceptance_test.rb
|
123
|
-
- test/
|
124
|
-
- test/
|
125
|
-
- test/
|
126
|
-
- test/
|
133
|
+
- test/benchmarks/bm_find.rb
|
134
|
+
- test/benchmarks/bm_find_all.rb
|
135
|
+
- test/benchmarks/bm_names.rb
|
136
|
+
- test/benchmarks/bm_select.rb
|
137
|
+
- test/benchmarks/bm_select_incremental.rb
|
138
|
+
- test/benchmarks/bm_valid.rb
|
139
|
+
- test/profilers/domain_profiler.rb
|
140
|
+
- test/profilers/find_profiler.rb
|
141
|
+
- test/profilers/find_profiler_jp.rb
|
142
|
+
- test/profilers/initialization_profiler.rb
|
143
|
+
- test/profilers/list_profsize.rb
|
144
|
+
- test/profilers/object_binsize.rb
|
127
145
|
- test/psl_test.rb
|
128
146
|
- test/test_helper.rb
|
129
147
|
- test/tests.txt
|
data/test/benchmark_helper.rb
DELETED
data/test/execution_profiler.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
-
|
3
|
-
require "memory_profiler"
|
4
|
-
require "public_suffix"
|
5
|
-
|
6
|
-
PublicSuffix::List.default
|
7
|
-
|
8
|
-
report = MemoryProfiler.report do
|
9
|
-
PublicSuffix.domain("www.example.com")
|
10
|
-
PublicSuffix.domain("a.b.ide.kyoto.jp")
|
11
|
-
end
|
12
|
-
|
13
|
-
report.pretty_print
|
14
|
-
# report.pretty_print(to_file: 'profiler-%s-%d.txt' % [ARGV[0], Time.now.to_i])
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require_relative "benchmark_helper"
|
2
|
-
|
3
|
-
iterations = 100_000
|
4
|
-
|
5
|
-
# force load
|
6
|
-
list = PublicSuffix::List.default
|
7
|
-
|
8
|
-
Benchmark.bmbm do |bm|
|
9
|
-
bm.report "Top level TLD" do
|
10
|
-
iterations.times do
|
11
|
-
PublicSuffix.domain("example.com", list)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
bm.report "Top level TLD (subdomain)" do
|
16
|
-
iterations.times do
|
17
|
-
PublicSuffix.domain("www.example.com", list)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
bm.report "Unlisted TLD" do
|
22
|
-
iterations.times do
|
23
|
-
PublicSuffix.domain("example.example", list)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
bm.report "Unlisted TLD (subdomain)" do
|
28
|
-
iterations.times do
|
29
|
-
PublicSuffix.domain("www.example.example", list)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
bm.report "Crazy suffix" do
|
34
|
-
iterations.times do
|
35
|
-
PublicSuffix.domain("a.b.ide.kyoto.jp", list)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|