whois 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -0
  3. data/.rubocop_opinionated.yml +157 -0
  4. data/.rubocop_todo.yml +242 -0
  5. data/.simplecov +2 -0
  6. data/.tool-versions +1 -0
  7. data/CHANGELOG.md +68 -53
  8. data/Gemfile +5 -0
  9. data/LICENSE.txt +1 -1
  10. data/README.md +1 -1
  11. data/Rakefile +12 -17
  12. data/bin/console +1 -0
  13. data/bin/whoisrb +3 -2
  14. data/data/ipv4.json +1 -3
  15. data/data/tld.json +2 -90
  16. data/lib/whois.rb +12 -10
  17. data/lib/whois/client.rb +4 -2
  18. data/lib/whois/errors.rb +4 -2
  19. data/lib/whois/record.rb +3 -1
  20. data/lib/whois/record/part.rb +4 -3
  21. data/lib/whois/server.rb +26 -21
  22. data/lib/whois/server/adapters/afilias.rb +4 -1
  23. data/lib/whois/server/adapters/arin.rb +5 -2
  24. data/lib/whois/server/adapters/arpa.rb +22 -19
  25. data/lib/whois/server/adapters/base.rb +4 -4
  26. data/lib/whois/server/adapters/formatted.rb +4 -2
  27. data/lib/whois/server/adapters/none.rb +3 -1
  28. data/lib/whois/server/adapters/not_implemented.rb +3 -1
  29. data/lib/whois/server/adapters/standard.rb +4 -2
  30. data/lib/whois/server/adapters/verisign.rb +4 -1
  31. data/lib/whois/server/adapters/web.rb +3 -1
  32. data/lib/whois/server/socket_handler.rb +8 -6
  33. data/lib/whois/version.rb +4 -2
  34. data/spec/integration/whois_spec.rb +6 -6
  35. data/spec/spec_helper.rb +4 -2
  36. data/spec/support/helpers/connectivity_helper.rb +2 -0
  37. data/spec/support/helpers/spec_helper.rb +2 -0
  38. data/spec/whois/client_spec.rb +6 -7
  39. data/spec/whois/record/part_spec.rb +4 -4
  40. data/spec/whois/record_spec.rb +9 -7
  41. data/spec/whois/server/adapters/afilias_spec.rb +3 -3
  42. data/spec/whois/server/adapters/arin_spec.rb +7 -8
  43. data/spec/whois/server/adapters/arpa_spec.rb +2 -2
  44. data/spec/whois/server/adapters/base_spec.rb +13 -13
  45. data/spec/whois/server/adapters/formatted_spec.rb +7 -7
  46. data/spec/whois/server/adapters/none_spec.rb +2 -2
  47. data/spec/whois/server/adapters/not_implemented_spec.rb +3 -3
  48. data/spec/whois/server/adapters/standard_spec.rb +5 -5
  49. data/spec/whois/server/adapters/verisign_spec.rb +3 -3
  50. data/spec/whois/server/adapters/web_spec.rb +3 -3
  51. data/spec/whois/server/socket_handler_spec.rb +7 -5
  52. data/spec/whois/server_spec.rb +31 -29
  53. data/spec/whois/{errors_spec.rb → web_interface_error_spec.rb} +4 -4
  54. data/spec/whois/whois_spec.rb +3 -3
  55. metadata +11 -8
  56. data/tasks/spec.rake +0 -199
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52436e2b73659a4173b3d88fef2d252538a01352f2b7a706268bfe97ac3f590e
4
- data.tar.gz: c5a52485ffd2c583e133f91b5e327cdec57823084244131f154b12877d6f385b
3
+ metadata.gz: f0135819e9f372668e91865f4dfffb8689adc4d8d3ea6e8d6317a78a911592d6
4
+ data.tar.gz: f4768ef62ed3d6321d044938c06ddcb66af3f2bb158078257ab6985c134f01a5
5
5
  SHA512:
6
- metadata.gz: 8603e49b42982d7c283fce5cc9db540ed017d5c4b90da87e3aa86ca676f369e0137aa794585fb784446a9067010c46108b13e471a9941a56b15cac9f32ecc9f1
7
- data.tar.gz: ac4a72c2a9ab24aa7bac3c213e5525cecebe76c0e1d6160ecda04a9f5d28d2a2a554b0ad60fe68eccf535515a405045ac9eb7983945993f83337eb99e3a93192
6
+ metadata.gz: 81be2e41c2505d79bb93bc2df3b3875e97fa52941aebf06107b7bdbcdf91d301b629ddc68bff22b6d411cbf16024732d1e69742d8d1357f7f30a8ecfd37a0652
7
+ data.tar.gz: 48166f89adc8bdd8b780d6d22fcb00992d75ffcb37063f1a4c4c207e429d0cffebb814dbe72f615dee79988f1576f7aee9382bfdd7dcb10e87d44d2481d5db51
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ inherit_from:
2
+ - .rubocop_opinionated.yml
3
+ - .rubocop_todo.yml
4
+
5
+ require:
6
+ - rubocop-rspec
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.5
10
+ Exclude:
11
+ # Exclude .gemspec files because they are generally auto-generated
12
+ - '*.gemspec'
13
+ # Exclude vendored folders
14
+ - 'tmp/**/*'
15
+ - 'vendor/**/*'
16
+ # Exclude artifacts
17
+ - 'pkg/**/*'
18
+ # Other
19
+ - 'test/benchmarks/**/*'
20
+ - 'test/profilers/**/*'
21
+ - 'utils/**/*'
22
+
23
+ Style/ClassAndModuleChildren:
24
+ Exclude:
25
+ - 'spec/**/*_spec.rb'
26
+ - 'test/**/*_test.rb'
@@ -0,0 +1,157 @@
1
+ AllCops:
2
+ Exclude:
3
+ # Exclude .gemspec files because they are generally auto-generated
4
+ - '*.gemspec'
5
+ # Exclude vendored folders
6
+ - 'tmp/**/*'
7
+ - 'vendor/**/*'
8
+ NewCops: enable
9
+
10
+ # [codesmell]
11
+ Layout/LineLength:
12
+ Enabled: false
13
+ Exclude:
14
+ - 'spec/**/*_spec.rb'
15
+ - 'test/**/*_test.rb'
16
+ Max: 100
17
+
18
+ # [codesmell]
19
+ Metrics/AbcSize:
20
+ Enabled: false
21
+ Exclude:
22
+ - 'spec/**/*_spec.rb'
23
+ - 'test/**/*_test.rb'
24
+
25
+ # [codesmell]
26
+ Metrics/BlockLength:
27
+ Enabled: false
28
+
29
+ # [codesmell]
30
+ Metrics/CyclomaticComplexity:
31
+ Enabled: false
32
+ Exclude:
33
+ - 'spec/**/*_spec.rb'
34
+ - 'test/**/*_test.rb'
35
+
36
+ # [codesmell]
37
+ Metrics/ClassLength:
38
+ Enabled: false
39
+ Exclude:
40
+ - 'spec/**/*_spec.rb'
41
+ - 'test/**/*_test.rb'
42
+
43
+ # [codesmell]
44
+ Metrics/MethodLength:
45
+ Enabled: false
46
+ Exclude:
47
+ - 'spec/**/*_spec.rb'
48
+ - 'test/**/*_test.rb'
49
+ Max: 10
50
+
51
+ # [codesmell]
52
+ Metrics/ModuleLength:
53
+ Enabled: false
54
+ Exclude:
55
+ - 'spec/**/*_spec.rb'
56
+ - 'test/**/*_test.rb'
57
+
58
+ # [codesmell]
59
+ Metrics/ParameterLists:
60
+ Enabled: false
61
+ Max: 5
62
+
63
+ # [codesmell]
64
+ Metrics/PerceivedComplexity:
65
+ Enabled: false
66
+
67
+ # Do not use "and" or "or" in conditionals, but for readability we can use it
68
+ # to chain executions. Just beware of operator order.
69
+ Style/AndOr:
70
+ EnforcedStyle: conditionals
71
+
72
+ Style/Documentation:
73
+ Exclude:
74
+ - 'spec/**/*'
75
+ - 'test/**/*'
76
+
77
+ # Double empty lines are useful to separate conceptually different methods
78
+ # in the same class or module.
79
+ Layout/EmptyLines:
80
+ Enabled: false
81
+
82
+ # In most cases, a space is nice. Sometimes, it's not.
83
+ # Just be consistent with the rest of the surrounding code.
84
+ Layout/EmptyLinesAroundClassBody:
85
+ Enabled: false
86
+
87
+ # In most cases, a space is nice. Sometimes, it's not.
88
+ # Just be consistent with the rest of the surrounding code.
89
+ Layout/EmptyLinesAroundModuleBody:
90
+ Enabled: false
91
+
92
+ # This is quite buggy, as it doesn't recognize double lines.
93
+ # Double empty lines are useful to separate conceptually different methods
94
+ # in the same class or module.
95
+ Layout/EmptyLineBetweenDefs:
96
+ Enabled: false
97
+
98
+ # I personally don't care about the format style.
99
+ # In most cases I like to use %, but not at the point I want to enforce it
100
+ # as a convention in the entire code.
101
+ Style/FormatString:
102
+ Enabled: false
103
+
104
+ # Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
105
+ # %s is a simpler and straightforward version that works in almost all cases. So don't complain.
106
+ Style/FormatStringToken:
107
+ Enabled: false
108
+
109
+ # unless is not always cool.
110
+ Style/NegatedIf:
111
+ Enabled: false
112
+
113
+ # For years, %w() has been the de-facto standard. A lot of libraries are using ().
114
+ # Switching to [] would be a nightmare.
115
+ Style/PercentLiteralDelimiters:
116
+ Enabled: false
117
+
118
+ # There are cases were the inline rescue is ok. We can either downgrade the severity,
119
+ # or rely on the developer judgement on a case-by-case basis.
120
+ Style/RescueModifier:
121
+ Enabled: false
122
+
123
+ Style/SymbolArray:
124
+ EnforcedStyle: brackets
125
+
126
+ # Sorry, but using trailing spaces helps readability.
127
+ #
128
+ # %w( foo bar )
129
+ #
130
+ # looks better to me than
131
+ #
132
+ # %w( foo bar )
133
+ #
134
+ Layout/SpaceInsidePercentLiteralDelimiters:
135
+ Enabled: false
136
+
137
+ # Hate It or Love It, I prefer double quotes as this is more consistent
138
+ # with several other programming languages and the output of puts and inspect.
139
+ Style/StringLiterals:
140
+ EnforcedStyle: double_quotes
141
+
142
+ # It's nice to be consistent. The trailing comma also allows easy reordering,
143
+ # and doesn't cause a diff in Git when you add a line to the bottom.
144
+ Style/TrailingCommaInArrayLiteral:
145
+ EnforcedStyleForMultiline: consistent_comma
146
+ Style/TrailingCommaInHashLiteral:
147
+ EnforcedStyleForMultiline: consistent_comma
148
+
149
+ Style/TrivialAccessors:
150
+ # IgnoreClassMethods because I want to be able to define class-level accessors
151
+ # that sets an instance variable on the metaclass, such as:
152
+ #
153
+ # def self.default=(value)
154
+ # @default = value
155
+ # end
156
+ #
157
+ IgnoreClassMethods: true
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,242 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-03-02 10:06:13 UTC using RuboCop version 1.11.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 5
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
12
+ Lint/UnusedMethodArgument:
13
+ Exclude:
14
+ - 'lib/whois.rb'
15
+ - 'lib/whois/server.rb'
16
+ - 'lib/whois/server/adapters/none.rb'
17
+ - 'lib/whois/server/adapters/not_implemented.rb'
18
+ - 'lib/whois/server/adapters/web.rb'
19
+
20
+ # Offense count: 61
21
+ # Cop supports --auto-correct.
22
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
23
+ # SupportedStyles: described_class, explicit
24
+ RSpec/DescribedClass:
25
+ Exclude:
26
+ - 'spec/integration/whois_spec.rb'
27
+ - 'spec/whois/server/adapters/not_implemented_spec.rb'
28
+ - 'spec/whois/server_spec.rb'
29
+
30
+ # Offense count: 35
31
+ # Configuration parameters: Max.
32
+ RSpec/ExampleLength:
33
+ Exclude:
34
+ - 'spec/integration/whois_spec.rb'
35
+ - 'spec/whois/client_spec.rb'
36
+ - 'spec/whois/record/part_spec.rb'
37
+ - 'spec/whois/record_spec.rb'
38
+ - 'spec/whois/server/adapters/afilias_spec.rb'
39
+ - 'spec/whois/server/adapters/arin_spec.rb'
40
+ - 'spec/whois/server/adapters/arpa_spec.rb'
41
+ - 'spec/whois/server/adapters/formatted_spec.rb'
42
+ - 'spec/whois/server/adapters/none_spec.rb'
43
+ - 'spec/whois/server/adapters/standard_spec.rb'
44
+ - 'spec/whois/server/adapters/verisign_spec.rb'
45
+ - 'spec/whois/server/socket_handler_spec.rb'
46
+ - 'spec/whois/server_spec.rb'
47
+
48
+ # Offense count: 2
49
+ # Cop supports --auto-correct.
50
+ # Configuration parameters: .
51
+ # SupportedStyles: implicit, each, example
52
+ RSpec/HookArgument:
53
+ EnforcedStyle: each
54
+
55
+ # Offense count: 4
56
+ # Configuration parameters: AssignmentOnly.
57
+ RSpec/InstanceVariable:
58
+ Exclude:
59
+ - 'spec/whois/server/adapters/not_implemented_spec.rb'
60
+ - 'spec/whois/server/adapters/web_spec.rb'
61
+
62
+ # Offense count: 54
63
+ # Configuration parameters: .
64
+ # SupportedStyles: have_received, receive
65
+ RSpec/MessageSpies:
66
+ EnforcedStyle: receive
67
+
68
+ # Offense count: 70
69
+ RSpec/MultipleExpectations:
70
+ Max: 5
71
+
72
+ # Offense count: 8
73
+ # Configuration parameters: IgnoreSharedExamples.
74
+ RSpec/NamedSubject:
75
+ Exclude:
76
+ - 'spec/whois/record_spec.rb'
77
+ - 'spec/whois/server/socket_handler_spec.rb'
78
+
79
+ # Offense count: 15
80
+ # Cop supports --auto-correct.
81
+ # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
82
+ # SupportedStyles: inflected, explicit
83
+ RSpec/PredicateMatcher:
84
+ Exclude:
85
+ - 'spec/whois/record_spec.rb'
86
+ - 'spec/whois/server/adapters/base_spec.rb'
87
+
88
+ # Offense count: 6
89
+ # Cop supports --auto-correct.
90
+ RSpec/ReceiveNever:
91
+ Exclude:
92
+ - 'spec/whois/server/adapters/afilias_spec.rb'
93
+ - 'spec/whois/server/adapters/arin_spec.rb'
94
+ - 'spec/whois/server/adapters/formatted_spec.rb'
95
+ - 'spec/whois/server/adapters/verisign_spec.rb'
96
+
97
+ # Offense count: 40
98
+ RSpec/StubbedMock:
99
+ Exclude:
100
+ - 'spec/integration/whois_spec.rb'
101
+ - 'spec/whois/client_spec.rb'
102
+ - 'spec/whois/server/adapters/afilias_spec.rb'
103
+ - 'spec/whois/server/adapters/arin_spec.rb'
104
+ - 'spec/whois/server/adapters/arpa_spec.rb'
105
+ - 'spec/whois/server/adapters/formatted_spec.rb'
106
+ - 'spec/whois/server/adapters/standard_spec.rb'
107
+ - 'spec/whois/server/adapters/verisign_spec.rb'
108
+ - 'spec/whois/server/socket_handler_spec.rb'
109
+ - 'spec/whois/server_spec.rb'
110
+ - 'spec/whois/whois_spec.rb'
111
+
112
+ # Offense count: 1
113
+ RSpec/SubjectStub:
114
+ Exclude:
115
+ - 'spec/whois/server/socket_handler_spec.rb'
116
+
117
+ # Offense count: 4
118
+ # Cop supports --auto-correct.
119
+ # Configuration parameters: EnforcedStyle.
120
+ # SupportedStyles: prefer_alias, prefer_alias_method
121
+ Style/Alias:
122
+ Exclude:
123
+ - 'lib/whois.rb'
124
+ - 'lib/whois/record.rb'
125
+ - 'lib/whois/server/adapters/base.rb'
126
+
127
+ # Offense count: 31
128
+ # Cop supports --auto-correct.
129
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
130
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
131
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
132
+ # FunctionalMethods: let, let!, subject, watch
133
+ # IgnoredMethods: lambda, proc, it
134
+ Style/BlockDelimiters:
135
+ Exclude:
136
+ - 'spec/whois/client_spec.rb'
137
+ - 'spec/whois/errors_spec.rb'
138
+ - 'spec/whois/record/part_spec.rb'
139
+ - 'spec/whois/record_spec.rb'
140
+ - 'spec/whois/server/adapters/base_spec.rb'
141
+ - 'spec/whois/server/adapters/formatted_spec.rb'
142
+ - 'spec/whois/server/adapters/none_spec.rb'
143
+ - 'spec/whois/server/adapters/not_implemented_spec.rb'
144
+ - 'spec/whois/server/adapters/web_spec.rb'
145
+ - 'spec/whois/server/socket_handler_spec.rb'
146
+ - 'spec/whois/server_spec.rb'
147
+
148
+ # Offense count: 6
149
+ Style/Documentation:
150
+ Exclude:
151
+ - 'spec/**/*'
152
+ - 'test/**/*'
153
+ - 'lib/whois.rb'
154
+ - 'lib/whois/client.rb'
155
+ - 'lib/whois/record.rb'
156
+ - 'lib/whois/server/adapters/arpa.rb'
157
+ - 'lib/whois/server/adapters/base.rb'
158
+ - 'lib/whois/server/adapters/not_implemented.rb'
159
+
160
+ # Offense count: 8
161
+ # Configuration parameters: MinBodyLength.
162
+ Style/GuardClause:
163
+ Exclude:
164
+ - 'lib/whois.rb'
165
+ - 'lib/whois/server.rb'
166
+ - 'lib/whois/server/adapters/afilias.rb'
167
+ - 'lib/whois/server/adapters/arin.rb'
168
+ - 'lib/whois/server/adapters/arpa.rb'
169
+ - 'lib/whois/server/adapters/verisign.rb'
170
+ - 'spec/support/helpers/connectivity_helper.rb'
171
+
172
+ # Offense count: 8
173
+ # Cop supports --auto-correct.
174
+ Style/IfUnlessModifier:
175
+ Exclude:
176
+ - 'lib/whois/server.rb'
177
+ - 'lib/whois/server/adapters/arpa.rb'
178
+ - 'spec/spec_helper.rb'
179
+ - 'spec/support/helpers/connectivity_helper.rb'
180
+
181
+ # Offense count: 1
182
+ # Cop supports --auto-correct.
183
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
184
+ # SupportedStyles: predicate, comparison
185
+ Style/NumericPredicate:
186
+ Exclude:
187
+ - 'spec/**/*'
188
+ - 'lib/whois/record/part.rb'
189
+
190
+ # Offense count: 13
191
+ # Cop supports --auto-correct.
192
+ Style/ParallelAssignment:
193
+ Exclude:
194
+ - 'spec/whois/record_spec.rb'
195
+ - 'spec/whois/server/adapters/base_spec.rb'
196
+
197
+ # Offense count: 3
198
+ # Cop supports --auto-correct.
199
+ Style/PerlBackrefs:
200
+ Exclude:
201
+ - 'lib/whois/server/adapters/arin.rb'
202
+
203
+ # Offense count: 1
204
+ # Cop supports --auto-correct.
205
+ Style/RedundantParentheses:
206
+ Exclude:
207
+ - 'lib/whois/server/adapters/base.rb'
208
+
209
+ # Offense count: 5
210
+ # Cop supports --auto-correct.
211
+ Style/RedundantSelf:
212
+ Exclude:
213
+ - 'lib/whois/server/adapters/base.rb'
214
+
215
+ # Offense count: 1
216
+ # Cop supports --auto-correct.
217
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
218
+ # SupportedStyles: slashes, percent_r, mixed
219
+ Style/RegexpLiteral:
220
+ Exclude:
221
+ - 'lib/whois/server/adapters/arin.rb'
222
+
223
+ # Offense count: 1
224
+ # Cop supports --auto-correct.
225
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
226
+ # AllowedMethods: present?, blank?, presence, try, try!
227
+ Style/SafeNavigation:
228
+ Exclude:
229
+ - 'lib/whois/server/socket_handler.rb'
230
+
231
+ # Offense count: 44
232
+ # Cop supports --auto-correct.
233
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
234
+ # SupportedStyles: single_quotes, double_quotes
235
+ Style/StringLiterals:
236
+ Enabled: false
237
+
238
+ # Offense count: 1
239
+ # Cop supports --auto-correct.
240
+ Style/ZeroLengthPredicate:
241
+ Exclude:
242
+ - 'lib/whois/record/part.rb'
data/.simplecov CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  SimpleCov.start do
2
4
  add_filter "/spec/"
3
5
  add_filter "/utils/"
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.0