whois 4.0.8 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +11 -0
  3. data/.rspec +1 -0
  4. data/.simplecov +4 -0
  5. data/.travis.yml +27 -0
  6. data/CHANGELOG.md +9 -0
  7. data/Gemfile +5 -0
  8. data/LICENSE.txt +1 -1
  9. data/README.md +1 -1
  10. data/Rakefile +33 -0
  11. data/data/tld.json +21 -21
  12. data/lib/whois.rb +1 -1
  13. data/lib/whois/client.rb +1 -1
  14. data/lib/whois/errors.rb +1 -1
  15. data/lib/whois/record.rb +1 -1
  16. data/lib/whois/record/part.rb +1 -1
  17. data/lib/whois/server.rb +14 -2
  18. data/lib/whois/server/adapters/afilias.rb +1 -1
  19. data/lib/whois/server/adapters/arin.rb +1 -1
  20. data/lib/whois/server/adapters/arpa.rb +1 -1
  21. data/lib/whois/server/adapters/base.rb +1 -1
  22. data/lib/whois/server/adapters/formatted.rb +1 -1
  23. data/lib/whois/server/adapters/none.rb +1 -1
  24. data/lib/whois/server/adapters/not_implemented.rb +1 -1
  25. data/lib/whois/server/adapters/standard.rb +1 -1
  26. data/lib/whois/server/adapters/verisign.rb +1 -1
  27. data/lib/whois/server/adapters/web.rb +1 -1
  28. data/lib/whois/server/socket_handler.rb +1 -1
  29. data/lib/whois/version.rb +2 -2
  30. data/spec/fixtures/referrals/afilias.bz.txt +23 -0
  31. data/spec/fixtures/referrals/arin_referral_apnic.txt +78 -0
  32. data/spec/fixtures/referrals/arin_referral_missing.txt +52 -0
  33. data/spec/fixtures/referrals/arin_referral_ripe.txt +50 -0
  34. data/spec/fixtures/referrals/arin_referral_rwhois.txt +63 -0
  35. data/spec/fixtures/referrals/arin_referral_servernap.txt +63 -0
  36. data/spec/fixtures/referrals/arin_referral_whois.txt +56 -0
  37. data/spec/fixtures/referrals/crsnic.com.txt +60 -0
  38. data/spec/fixtures/referrals/crsnic.com_referral.txt +56 -0
  39. data/spec/fixtures/referrals/crsnic.com_referral_missing.txt +50 -0
  40. data/spec/integration/whois_spec.rb +73 -0
  41. data/spec/spec_helper.rb +24 -0
  42. data/spec/support/helpers/connectivity_helper.rb +15 -0
  43. data/spec/support/helpers/spec_helper.rb +31 -0
  44. data/spec/whois/client_spec.rb +144 -0
  45. data/spec/whois/errors_spec.rb +23 -0
  46. data/spec/whois/record/part_spec.rb +38 -0
  47. data/spec/whois/record_spec.rb +158 -0
  48. data/spec/whois/server/adapters/afilias_spec.rb +49 -0
  49. data/spec/whois/server/adapters/arin_spec.rb +84 -0
  50. data/spec/whois/server/adapters/arpa_spec.rb +20 -0
  51. data/spec/whois/server/adapters/base_spec.rb +150 -0
  52. data/spec/whois/server/adapters/formatted_spec.rb +53 -0
  53. data/spec/whois/server/adapters/none_spec.rb +23 -0
  54. data/spec/whois/server/adapters/not_implemented_spec.rb +24 -0
  55. data/spec/whois/server/adapters/standard_spec.rb +42 -0
  56. data/spec/whois/server/adapters/verisign_spec.rb +60 -0
  57. data/spec/whois/server/adapters/web_spec.rb +24 -0
  58. data/spec/whois/server/socket_handler_spec.rb +27 -0
  59. data/spec/whois/server_spec.rb +300 -0
  60. data/spec/whois/whois_spec.rb +15 -0
  61. data/tasks/spec.rake +199 -0
  62. data/utils/compare-whois.rb +30 -0
  63. data/utils/deftld.rb +231 -0
  64. data/utils/defutils.rb +26 -0
  65. data/utils/fixupd.rb +60 -0
  66. data/utils/matrix.rb +68 -0
  67. data/utils/mkwhois.rb +31 -0
  68. data/whois.gemspec +19 -32
  69. metadata +82 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ceee66f346949801d7f9842dde39aab3edbd62bf3836c4ea292bf0f0b4e5448
4
- data.tar.gz: 28e5c725e4cab668dc5a8c96a72644b9eddad639bd19a8869e1c95c6ef7d3a35
3
+ metadata.gz: 773dd2acabcae709561c0df052e5944c14e80222e2f72b906d39f77c759b75ce
4
+ data.tar.gz: c880c0cff8ccd5d4664a0a2cb6b8c3e9b2bb7c51c799590fbd76b2eea625d46b
5
5
  SHA512:
6
- metadata.gz: 1f9befdc56326dccc6de48db994a64fdb101c85749e72a597b44f181dec3c560eafc0a5c3403545dd910cd5760d24273ede3d62e7836681602955f241a256502
7
- data.tar.gz: 5237a002a9ad8451ff2456c9829cda192d93fadeb741684987a25ed3475d444da70300870fd6764472273f4be6556a3b0269e5f4663e8ebe9a4abb05a66456e7
6
+ metadata.gz: cc50bbd4351a84cb089bbadba87af67430b1a023e163252f304ec1b5ec999856bc80fe74b5ef2908dd7fcdd13dfd44d0a483741e9a6fe189ffafb0babd71506e
7
+ data.tar.gz: a8491c66c374029d51a9d1fbd2c431891b21199c06fee62a0e6f27143b877d56eb4619a0bae8da162b60cb29c61b8b2a57ddc59fc04079641c709eaab215d417
@@ -0,0 +1,11 @@
1
+ # Bundler
2
+ /.bundle/
3
+ /Gemfile.lock
4
+ /pkg/
5
+
6
+ # YARD
7
+ /.yardoc
8
+ /_yardoc/
9
+ /doc/
10
+
11
+ utils/whois-utf8.rb
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,4 @@
1
+ SimpleCov.start do
2
+ add_filter "/spec/"
3
+ add_filter "/utils/"
4
+ end
@@ -0,0 +1,27 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ # - 2.1
5
+ # - 2.2
6
+ - 2.3
7
+ - 2.4
8
+ - 2.5
9
+ - 2.6
10
+ - jruby-9.1.5.0
11
+ - ruby-head
12
+
13
+ env:
14
+ - COVERALL=1
15
+
16
+ cache:
17
+ - bundler
18
+
19
+ matrix:
20
+ allow_failures:
21
+ - rvm: ruby-head
22
+ - rvm: jruby-head
23
+ - rvm: jruby-9.1.5.0
24
+
25
+ before_install:
26
+ # - rvm get latest
27
+ - gem install bundler
@@ -3,6 +3,15 @@
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
5
 
6
+ #### Release 4.1.0
7
+
8
+ - SERVER: Add .SS
9
+ - SERVER: Update .ALLFINANZ, .CAM, .DVAG, .FRESENIUS, .POHL, .TUI, .XN--VERMGENSBERATER-CTB, .XN--VERMGENSBERATUNG-PWB, .ZUERICH, .BMW, .MINI, .BABY, .DESI, .SAARLAND, .ECO
10
+ - SERVER: Deleted .DOHA
11
+
12
+ - ENHANCED: Reduce string allocations and retentions (GH-437). Thanks @casperisfine @byroot
13
+
14
+
6
15
  #### Release 4.0.8
7
16
 
8
17
  - SERVER: Deleted .XPERIA, .TELECITY, .VISTA, .JLC, .PANERAI, .GOODHANDS, .STATOIL, .ACTIVE, .BLANCO, .EPOST, .SPIEGEL, .ZIPPO
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'coveralls', require: false
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2009-2018 Simone Carletti
3
+ Copyright (c) 2009-2019 Simone Carletti
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -213,4 +213,4 @@ Report issues or feature requests to [GitHub Issues](https://github.com/weppos/w
213
213
 
214
214
  ## License
215
215
 
216
- Copyright (c) 2009-2018 [Simone Carletti](https://simonecarletti.com/). This is Free Software distributed under the MIT license.
216
+ Copyright (c) 2009-2019 [Simone Carletti](https://simonecarletti.com/). This is Free Software distributed under the MIT license.
@@ -0,0 +1,33 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+
4
+ # Run test by default.
5
+ task :default => :spec
6
+ task :test => :spec
7
+
8
+
9
+ require 'rspec/core/rake_task'
10
+
11
+ RSpec::Core::RakeTask.new do |t|
12
+ t.verbose = !ENV["VERBOSE"].nil?
13
+ end
14
+
15
+
16
+ require 'yard'
17
+
18
+ YARD::Rake::YardocTask.new(:yardoc) do |y|
19
+ y.options = ["--output-dir", "yardoc"]
20
+ end
21
+
22
+ namespace :yardoc do
23
+ task :clobber do
24
+ rm_r "yardoc" rescue nil
25
+ end
26
+ end
27
+
28
+ task :clobber => "yardoc:clobber"
29
+
30
+
31
+ Dir["tasks/**/*.rake"].each do |file|
32
+ load(file)
33
+ end
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_": {
3
3
  "schema": "2",
4
- "updated": "2019-03-03 15:29:59 UTC"
4
+ "updated": "2019-04-19 09:09:51 UTC"
5
5
  },
6
6
  "aaa": {
7
7
  "_type": "newgtld",
@@ -189,7 +189,7 @@
189
189
  "allfinanz": {
190
190
  "_group": "ksregistry",
191
191
  "_type": "newgtld",
192
- "host": "whois.ksregistry.net"
192
+ "host": "whois.nic.allfinanz"
193
193
  },
194
194
  "allstate": {
195
195
  "_group": "afiliassrs",
@@ -426,7 +426,7 @@
426
426
  },
427
427
  "baby": {
428
428
  "_type": "newgtld",
429
- "adapter": "none"
429
+ "host": "whois.nic.baby"
430
430
  },
431
431
  "baidu": {
432
432
  "_group": "knet",
@@ -649,7 +649,7 @@
649
649
  "bmw": {
650
650
  "_group": "ksregistry",
651
651
  "_type": "newgtld",
652
- "host": "whois.ksregistry.net"
652
+ "host": "whois.nic.bmw"
653
653
  },
654
654
  "bn": {
655
655
  "host": "whois.bnnic.bn"
@@ -859,7 +859,7 @@
859
859
  "cam": {
860
860
  "_group": "ksregistry",
861
861
  "_type": "newgtld",
862
- "host": "whois.ksregistry.net"
862
+ "host": "whois.nic.cam"
863
863
  },
864
864
  "camera": {
865
865
  "_group": "donuts",
@@ -1608,7 +1608,7 @@
1608
1608
  "desi": {
1609
1609
  "_group": "ksregistry",
1610
1610
  "_type": "newgtld",
1611
- "host": "whois.ksregistry.net"
1611
+ "host": "whois.nic.desi"
1612
1612
  },
1613
1613
  "design": {
1614
1614
  "_type": "newgtld",
@@ -1706,10 +1706,6 @@
1706
1706
  "_type": "newgtld",
1707
1707
  "host": "whois.nic.dog"
1708
1708
  },
1709
- "doha": {
1710
- "_type": "newgtld",
1711
- "host": "whois.nic.doha"
1712
- },
1713
1709
  "domains": {
1714
1710
  "_group": "donuts",
1715
1711
  "_type": "newgtld",
@@ -1766,7 +1762,7 @@
1766
1762
  "dvag": {
1767
1763
  "_group": "ksregistry",
1768
1764
  "_type": "newgtld",
1769
- "host": "whois.ksregistry.net"
1765
+ "host": "whois.nic.dvag"
1770
1766
  },
1771
1767
  "dvr": {
1772
1768
  "_group": "afiliassrs",
@@ -1791,7 +1787,7 @@
1791
1787
  "eco": {
1792
1788
  "_group": "afiliassrs",
1793
1789
  "_type": "newgtld",
1794
- "host": "whois.afilias-srs.net"
1790
+ "host": "whois.nic.eco"
1795
1791
  },
1796
1792
  "edeka": {
1797
1793
  "_group": "afiliassrs",
@@ -2226,7 +2222,7 @@
2226
2222
  "fresenius": {
2227
2223
  "_group": "ksregistry",
2228
2224
  "_type": "newgtld",
2229
- "host": "whois.ksregistry.net"
2225
+ "host": "whois.nic.fresenius"
2230
2226
  },
2231
2227
  "frl": {
2232
2228
  "_type": "newgtld",
@@ -2333,6 +2329,7 @@
2333
2329
  "host": "whois.nic.google"
2334
2330
  },
2335
2331
  "gd": {
2332
+ "_group": "centralnic",
2336
2333
  "host": "whois.nic.gd"
2337
2334
  },
2338
2335
  "gdn": {
@@ -3698,7 +3695,7 @@
3698
3695
  "mini": {
3699
3696
  "_group": "ksregistry",
3700
3697
  "_type": "newgtld",
3701
- "host": "whois.ksregistry.net"
3698
+ "host": "whois.nic.mini"
3702
3699
  },
3703
3700
  "mint": {
3704
3701
  "_type": "newgtld",
@@ -3881,7 +3878,7 @@
3881
3878
  "host": "whois.nic.mw"
3882
3879
  },
3883
3880
  "mx": {
3884
- "host": "whois.nic.mx"
3881
+ "host": "whois.mx"
3885
3882
  },
3886
3883
  "my": {
3887
3884
  "host": "whois.mynic.my"
@@ -4488,7 +4485,7 @@
4488
4485
  "pohl": {
4489
4486
  "_group": "ksregistry",
4490
4487
  "_type": "newgtld",
4491
- "host": "whois.ksregistry.net"
4488
+ "host": "whois.nic.pohl"
4492
4489
  },
4493
4490
  "poker": {
4494
4491
  "_group": "afilias",
@@ -4859,7 +4856,7 @@
4859
4856
  "saarland": {
4860
4857
  "_group": "ksregistry",
4861
4858
  "_type": "newgtld",
4862
- "host": "whois.ksregistry.net"
4859
+ "host": "whois.nic.saarland"
4863
4860
  },
4864
4861
  "safe": {
4865
4862
  "_group": "amazonregistry",
@@ -5294,6 +5291,9 @@
5294
5291
  "_type": "newgtld",
5295
5292
  "host": "whois.afilias-srs.net"
5296
5293
  },
5294
+ "ss": {
5295
+ "host": "whois.nic.ss"
5296
+ },
5297
5297
  "st": {
5298
5298
  "host": "whois.nic.st"
5299
5299
  },
@@ -5735,7 +5735,7 @@
5735
5735
  "tui": {
5736
5736
  "_group": "ksregistry",
5737
5737
  "_type": "newgtld",
5738
- "host": "whois.ksregistry.net"
5738
+ "host": "whois.nic.tui"
5739
5739
  },
5740
5740
  "tunes": {
5741
5741
  "_group": "amazonregistry",
@@ -6747,12 +6747,12 @@
6747
6747
  "xn--vermgensberater-ctb": {
6748
6748
  "_group": "ksregistry",
6749
6749
  "_type": "newgtld",
6750
- "host": "whois.ksregistry.net"
6750
+ "host": "whois.nic.xn--vermgensberater-ctb"
6751
6751
  },
6752
6752
  "xn--vermgensberatung-pwb": {
6753
6753
  "_group": "ksregistry",
6754
6754
  "_type": "newgtld",
6755
- "host": "whois.ksregistry.net"
6755
+ "host": "whois.nic.xn--vermgensberatung-pwb"
6756
6756
  },
6757
6757
  "xn--vhquv": {
6758
6758
  "_group": "donuts",
@@ -6918,7 +6918,7 @@
6918
6918
  "zuerich": {
6919
6919
  "_group": "ksregistry",
6920
6920
  "_type": "newgtld",
6921
- "host": "whois.ksregistry.net"
6921
+ "host": "whois.nic.zuerich"
6922
6922
  },
6923
6923
  "zw": {
6924
6924
  "adapter": "none"
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  #--
2
3
  # Ruby Whois
3
4
  #
4
5
  # An intelligent pure Ruby WHOIS client and parser.
5
6
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
7
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
8
  #++
8
9
 
9
10
 
@@ -75,7 +76,9 @@ module Whois
75
76
  JSON.load(File.read(file)).each do |allocation, settings|
76
77
  next if allocation == "_"
77
78
  settings.reject! { |k, _| k.start_with?("_") }
78
- define(type, allocation, settings.delete("host"), Hash[settings.map { |k,v| [k.to_sym, v] }])
79
+ host = settings.delete("host")
80
+ host = intern_string(host) if host
81
+ define(type, allocation, host, Hash[settings.map { |k,v| [k.to_sym, v.is_a?(String) ? intern_string(v) : v] }])
79
82
  end
80
83
  end
81
84
 
@@ -336,6 +339,15 @@ module Whois
336
339
  end
337
340
  end
338
341
 
342
+ if String.method_defined?(:-@)
343
+ def intern_string(string)
344
+ -string
345
+ end
346
+ else
347
+ def intern_string(string)
348
+ string.freeze
349
+ end
350
+ end
339
351
 
340
352
  def camelize(string)
341
353
  string.to_s.split("_").collect(&:capitalize).join
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # An intelligent pure Ruby WHOIS client and parser.
5
5
  #
6
- # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
6
+ # Copyright (c) 2009-2019 Simone Carletti <weppos@weppos.net>
7
7
  #++
8
8
 
9
9