public_suffix_service 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,7 +1,5 @@
1
- .DS_Store
1
+ .bundle
2
2
  .idea
3
3
  .yardoc
4
- pkg
5
- rdoc
4
+ pkg/*
6
5
  yardoc
7
- coverage
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## Release 0.8.3
5
+
6
+ * FIXED: Fixed ArgumentError: invalid byte sequence in US-ASCII with Ruby 1.9.2 (#12).
7
+
8
+ * CHANGED: Updated definitions (#11).
9
+
10
+ * CHANGED: Renamed definitions.txt to definitions.dat.
11
+
12
+
4
13
  ## Release 0.8.2
5
14
 
6
15
  * NEW: Added support for rubygems-test.
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- public_suffix_service (0.8.1)
4
+ public_suffix_service (0.8.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
9
  rr (1.0.2)
10
+ yard (0.7.1)
10
11
 
11
12
  PLATFORMS
12
13
  ruby
@@ -14,3 +15,4 @@ PLATFORMS
14
15
  DEPENDENCIES
15
16
  public_suffix_service!
16
17
  rr
18
+ yard
data/README.md CHANGED
@@ -43,7 +43,7 @@ Successfully tested with the following interpreters
43
43
 
44
44
  ## Installation
45
45
 
46
- The best way to install Public Suffix Service is via {RubyGems}[http://www.rubygems.org].
46
+ The best way to install Public Suffix Service is via [RubyGems](http://www.rubygems.org).
47
47
 
48
48
  $ gem install public_suffix_service
49
49
 
data/Rakefile CHANGED
@@ -39,15 +39,12 @@ task :default => ["test"]
39
39
  spec = Gem::Specification.new do |s|
40
40
  s.name = PKG_NAME
41
41
  s.version = PKG_VERSION
42
- s.summary = "Domain Name parser based on the Public Suffix List"
42
+ s.summary = "Domain name parser based in the Public Suffix List."
43
+ s.description = "PublicSuffixService can parse and decompose a domain name into top level domain, domain and subdomains."
44
+
43
45
  s.author = "Simone Carletti"
44
46
  s.email = "weppos@weppos.net"
45
47
  s.homepage = "http://www.simonecarletti.com/code/public_suffix_service"
46
- s.description = <<-EOD
47
- Intelligent domain name parser based in the Public Suffix List. \
48
- PublicSuffixService can parse and decompose a domain name into top level domain, \
49
- domain and subdomains.
50
- EOD
51
48
 
52
49
  # Add any extra files to include in the gem (like your README)
53
50
  s.files = `git ls-files`.split("\n")
@@ -124,7 +121,7 @@ task :download_definitions do
124
121
 
125
122
  DEFINITION_URL = "http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1"
126
123
 
127
- File.open("lib/public_suffix_service/definitions.dat", "w+") do |f|
124
+ File.open("lib/public_suffix_service/definitions.txt", "w+") do |f|
128
125
  response = Net::HTTP.get_response(URI.parse(DEFINITION_URL))
129
126
  f.write(response.body)
130
127
  end
@@ -432,9 +432,8 @@ net.bo
432
432
  mil.bo
433
433
  tv.bo
434
434
 
435
- // br : http://en.wikipedia.org/wiki/.br
436
- // http://registro.br/info/dpn.html
437
- // Confirmed by registry <fneves@registro.br> 2008-06-24
435
+ // br : http://registro.br/dominio/dpn.html
436
+ // Updated by registry <fneves@registro.br> 2011-03-01
438
437
  br
439
438
  adm.br
440
439
  adv.br
@@ -443,6 +442,7 @@ am.br
443
442
  arq.br
444
443
  art.br
445
444
  ato.br
445
+ b.br
446
446
  bio.br
447
447
  blog.br
448
448
  bmd.br
@@ -454,6 +454,7 @@ com.br
454
454
  coop.br
455
455
  ecn.br
456
456
  edu.br
457
+ emp.br
457
458
  eng.br
458
459
  esp.br
459
460
  etc.br
@@ -488,9 +489,12 @@ pro.br
488
489
  psc.br
489
490
  psi.br
490
491
  qsl.br
492
+ radio.br
491
493
  rec.br
492
494
  slg.br
493
495
  srv.br
496
+ taxi.br
497
+ teo.br
494
498
  tmp.br
495
499
  trd.br
496
500
  tur.br
@@ -774,7 +778,17 @@ edu.dm
774
778
  gov.dm
775
779
 
776
780
  // do : http://en.wikipedia.org/wiki/.do
777
- *.do
781
+ do
782
+ art.do
783
+ com.do
784
+ edu.do
785
+ gob.do
786
+ gov.do
787
+ mil.do
788
+ net.do
789
+ org.do
790
+ sld.do
791
+ web.do
778
792
 
779
793
  // dz : http://en.wikipedia.org/wiki/.dz
780
794
  dz
@@ -820,7 +834,16 @@ org.ee
820
834
  fie.ee
821
835
 
822
836
  // eg : http://en.wikipedia.org/wiki/.eg
823
- *.eg
837
+ eg
838
+ com.eg
839
+ edu.eg
840
+ eun.eg
841
+ gov.eg
842
+ mil.eg
843
+ name.eg
844
+ net.eg
845
+ org.eg
846
+ sci.eg
824
847
 
825
848
  // er : http://en.wikipedia.org/wiki/.er
826
849
  *.er
@@ -2657,6 +2680,9 @@ nl
2657
2680
  // BV.nl will be a registry for dutch BV's (besloten vennootschap)
2658
2681
  bv.nl
2659
2682
 
2683
+ // the co.nl domain is managed by CoDNS B.V. Added 2010-05-23.
2684
+ co.nl
2685
+
2660
2686
  // no : http://www.norid.no/regelverk/index.en.html
2661
2687
  // The Norwegian registry has declined to notify us of updates. The web pages
2662
2688
  // referenced below are the official source of the data. There is also an
@@ -3424,6 +3450,9 @@ våler.østfold.no
3424
3450
  valer.hedmark.no
3425
3451
  våler.hedmark.no
3426
3452
 
3453
+ // the co.no domain is managed by CoDNS B.V. Added 2010-05-23.
3454
+ co.no
3455
+
3427
3456
  // np : http://www.mos.com.np/register.html
3428
3457
  *.np
3429
3458
 
@@ -4248,7 +4277,6 @@ mil.to
4248
4277
  // tr : http://en.wikipedia.org/wiki/.tr
4249
4278
  *.tr
4250
4279
  !nic.tr
4251
- !tsk.tr
4252
4280
  // Used by government in the TRNC
4253
4281
  // http://en.wikipedia.org/wiki/.nc.tr
4254
4282
  gov.nc.tr
@@ -4379,12 +4407,16 @@ or.ug
4379
4407
  !bl.uk
4380
4408
  !british-library.uk
4381
4409
  !icnet.uk
4410
+ !gov.uk
4382
4411
  !jet.uk
4412
+ !mod.uk
4383
4413
  !nel.uk
4384
4414
  !nhs.uk
4415
+ !nic.uk
4385
4416
  !nls.uk
4386
4417
  !national-library-scotland.uk
4387
4418
  !parliament.uk
4419
+ !police.uk
4388
4420
 
4389
4421
  // us : http://en.wikipedia.org/wiki/.us
4390
4422
  us
@@ -4709,6 +4741,9 @@ edu.ws
4709
4741
  //http://nic.ae/english/arabicdomain/rules.jsp
4710
4742
  امارات
4711
4743
 
4744
+ // xn--54b7fta0cc ("Bangla" Bangla) : BD
4745
+ বাংলা
4746
+
4712
4747
  // xn--fiqs8s ("China" Chinese-Han-Simplified <.Zhonggou>) : CN
4713
4748
  // CNNIC
4714
4749
  // http://cnnic.cn/html/Dir/2005/10/11/3218.htm
@@ -4719,19 +4754,62 @@ edu.ws
4719
4754
  // http://cnnic.cn/html/Dir/2005/10/11/3218.htm
4720
4755
  中國
4721
4756
 
4757
+ // xn--lgbbat1ad8j ("Algeria / Al Jazair" Arabic) : DZ
4758
+ الجزائر
4759
+
4722
4760
  // xn--wgbh1c ("Egypt" Arabic .masr) : EG
4723
4761
  // http://www.dotmasr.eg/
4724
4762
  مصر
4725
4763
 
4764
+ // xn--node ("ge" Georgian (Mkhedruli)) : GE
4765
+ გე
4766
+
4726
4767
  // xn--j6w193g ("Hong Kong" Chinese-Han) : HK
4727
4768
  // https://www2.hkirc.hk/register/rules.jsp
4728
4769
  香港
4729
4770
 
4771
+ // xn--h2brj9c ("Bharat" Devanagari) : IN
4772
+ // India
4773
+ भारत
4774
+
4775
+ // xn--mgbbh1a71e ("Bharat" Arabic) : IN
4776
+ // India
4777
+ بھارت
4778
+
4779
+ // xn--fpcrj9c3d ("Bharat" Telugu) : IN
4780
+ // India
4781
+ భారత్
4782
+
4783
+ // xn--gecrj9c ("Bharat" Gujarati) : IN
4784
+ // India
4785
+ ભારત
4786
+
4787
+ // xn--s9brj9c ("Bharat" Gurmukhi) : IN
4788
+ // India
4789
+ ਭਾਰਤ
4790
+
4791
+ // xn--45brj9c ("Bharat" Bengali) : IN
4792
+ // India
4793
+ ভারত
4794
+
4795
+ // xn--xkc2dl3a5ee0h ("India" Tamil) : IN
4796
+ // India
4797
+ இந்தியா
4798
+
4799
+ // xn--mgba3a4f16a ("Iran" Persian) : IR
4800
+ ایران
4801
+
4802
+ // xn--mgba3a4fra ("Iran" Arabic) : IR
4803
+ ايران
4804
+
4730
4805
  //xn--mgbayh7gpa ("al-Ordon" Arabic) JO
4731
4806
  //National Information Technology Center (NITC)
4732
4807
  //Royal Scientific Society, Al-Jubeiha
4733
4808
  الاردن
4734
4809
 
4810
+ // xn--3e0b707e ("Republic of Korea" Hangul) : KR
4811
+ 한국
4812
+
4735
4813
  // xn--fzc2c9e2c ("Lanka" Sinhalese-Sinhala) : LK
4736
4814
  // http://nic.lk
4737
4815
  ලංකා
@@ -4740,23 +4818,47 @@ edu.ws
4740
4818
  // http://nic.lk
4741
4819
  இலங்கை
4742
4820
 
4821
+ // xn--mgbc0a9azcg ("Morocco / al-Maghrib" Arabic) : MA
4822
+ المغرب
4823
+
4824
+ // xn--mgb9awbf ("Oman" Arabic) : OM
4825
+ عمان
4826
+
4743
4827
  // xn--ygbi2ammx ("Falasteen" Arabic) : PS
4744
4828
  // The Palestinian National Internet Naming Authority (PNINA)
4745
4829
  // http://www.pnina.ps
4746
4830
  فلسطين
4747
4831
 
4832
+ // xn--90a3ac ("srb" Cyrillic) : RS
4833
+ срб
4834
+
4748
4835
  // xn--p1ai ("rf" Russian-Cyrillic) : RU
4749
4836
  // http://www.cctld.ru/en/docs/rulesrf.php
4750
4837
  рф
4751
4838
 
4752
4839
  // xn--wgbl6a ("Qatar" Arabic) : QA
4753
4840
  // http://www.ict.gov.qa/
4754
- قطر
4841
+ قطر
4755
4842
 
4756
4843
  // xn--mgberp4a5d4ar ("AlSaudiah" Arabic) : SA
4757
4844
  // http://www.nic.net.sa/
4758
4845
  السعودية
4759
4846
 
4847
+ // xn--mgberp4a5d4a87g ("AlSaudiah" Arabic) variant : SA
4848
+ السعودیة
4849
+
4850
+ // xn--mgbqly7c0a67fbc ("AlSaudiah" Arabic) variant : SA
4851
+ السعودیۃ
4852
+
4853
+ // xn--mgbqly7cvafr ("AlSaudiah" Arabic) variant : SA
4854
+ السعوديه
4855
+
4856
+ // xn--ogbpf8fl ("Syria" Arabic) : SY
4857
+ سورية
4858
+
4859
+ // xn--mgbtf8fl ("Syria" Arabic) variant : SY
4860
+ سوريا
4861
+
4760
4862
  // xn--yfro4i67o Singapore ("Singapore" Chinese-Han) : SG
4761
4863
  新加坡
4762
4864
 
@@ -4779,6 +4881,18 @@ edu.ws
4779
4881
  // http://www.twnic.net/english/dn/dn_07a.htm
4780
4882
  台湾
4781
4883
 
4884
+ // xn--nnx388a ("Taiwan") variant : TW
4885
+ 臺灣
4886
+
4887
+ // xn--j1amh ("ukr" Cyrillic) : UA
4888
+ укр
4889
+
4890
+ // xn--mgb2ddes ("AlYemen" Arabic) : YE
4891
+ اليمن
4892
+
4893
+ // xxx : http://icmregistry.com
4894
+ xxx
4895
+
4782
4896
  // ye : http://www.y.net.ye/services/domain_name.htm
4783
4897
  *.ye
4784
4898
 
@@ -247,7 +247,7 @@ module PublicSuffixService
247
247
  #
248
248
  # @return [File]
249
249
  def default_definition
250
- File.new(File.join(File.dirname(__FILE__), "definitions.dat"))
250
+ File.new(File.join(File.dirname(__FILE__), "definitions.txt"), "r:utf-8")
251
251
  end
252
252
 
253
253
 
@@ -12,7 +12,7 @@ module PublicSuffixService
12
12
  module Version
13
13
  MAJOR = 0
14
14
  MINOR = 8
15
- PATCH = 2
15
+ PATCH = 3
16
16
  BUILD = nil
17
17
 
18
18
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
@@ -2,20 +2,19 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{public_suffix_service}
5
- s.version = "0.8.2"
5
+ s.version = "0.8.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Simone Carletti"]
9
- s.date = %q{2011-03-11}
10
- s.description = %q{ Intelligent domain name parser based in the Public Suffix List. PublicSuffixService can parse and decompose a domain name into top level domain, domain and subdomains.
11
- }
8
+ s.authors = [%q{Simone Carletti}]
9
+ s.date = %q{2011-05-27}
10
+ s.description = %q{PublicSuffixService can parse and decompose a domain name into top level domain, domain and subdomains.}
12
11
  s.email = %q{weppos@weppos.net}
13
- s.files = [".gemtest", ".gitignore", ".yardopts", "CHANGELOG.md", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "lib/public_suffix_service.rb", "lib/public_suffix_service/definitions.dat", "lib/public_suffix_service/domain.rb", "lib/public_suffix_service/errors.rb", "lib/public_suffix_service/rule.rb", "lib/public_suffix_service/rule_list.rb", "lib/public_suffix_service/version.rb", "public_suffix_service.gemspec", "test/acceptance_test.rb", "test/public_suffix_service/domain_test.rb", "test/public_suffix_service/errors_test.rb", "test/public_suffix_service/rule_list_test.rb", "test/public_suffix_service/rule_test.rb", "test/public_suffix_service_test.rb", "test/test_helper.rb"]
12
+ s.files = [%q{.gemtest}, %q{.gitignore}, %q{.yardopts}, %q{CHANGELOG.md}, %q{Gemfile}, %q{Gemfile.lock}, %q{LICENSE}, %q{README.md}, %q{Rakefile}, %q{lib/public_suffix_service.rb}, %q{lib/public_suffix_service/definitions.txt}, %q{lib/public_suffix_service/domain.rb}, %q{lib/public_suffix_service/errors.rb}, %q{lib/public_suffix_service/rule.rb}, %q{lib/public_suffix_service/rule_list.rb}, %q{lib/public_suffix_service/version.rb}, %q{public_suffix_service.gemspec}, %q{test/acceptance_test.rb}, %q{test/public_suffix_service/domain_test.rb}, %q{test/public_suffix_service/errors_test.rb}, %q{test/public_suffix_service/rule_list_test.rb}, %q{test/public_suffix_service/rule_test.rb}, %q{test/public_suffix_service_test.rb}, %q{test/test_helper.rb}]
14
13
  s.homepage = %q{http://www.simonecarletti.com/code/public_suffix_service}
15
- s.require_paths = ["lib"]
16
- s.rubygems_version = %q{1.6.1}
17
- s.summary = %q{Domain Name parser based on the Public Suffix List}
18
- s.test_files = ["test/acceptance_test.rb", "test/public_suffix_service/domain_test.rb", "test/public_suffix_service/errors_test.rb", "test/public_suffix_service/rule_list_test.rb", "test/public_suffix_service/rule_test.rb", "test/public_suffix_service_test.rb", "test/test_helper.rb"]
14
+ s.require_paths = [%q{lib}]
15
+ s.rubygems_version = %q{1.8.4}
16
+ s.summary = %q{Domain name parser based in the Public Suffix List.}
17
+ s.test_files = [%q{test/acceptance_test.rb}, %q{test/public_suffix_service/domain_test.rb}, %q{test/public_suffix_service/errors_test.rb}, %q{test/public_suffix_service/rule_list_test.rb}, %q{test/public_suffix_service/rule_test.rb}, %q{test/public_suffix_service_test.rb}, %q{test/test_helper.rb}]
19
18
 
20
19
  if s.respond_to? :specification_version then
21
20
  s.specification_version = 3
@@ -24,7 +24,7 @@ class AcceptanceTest < Test::Unit::TestCase
24
24
  end
25
25
 
26
26
  InvalidCases = {
27
- "nic.do" => PublicSuffixService::DomainNotAllowed,
27
+ "nic.ke" => PublicSuffixService::DomainNotAllowed,
28
28
  }
29
29
 
30
30
  def test_invalid
@@ -148,9 +148,9 @@ class PublicSuffixService::DomainTest < Test::Unit::TestCase
148
148
  assert !@klass.new("zip", "example", "www").valid?
149
149
 
150
150
  # not-allowed
151
- assert !@klass.new("do").valid?
152
- assert !@klass.new("do", "example").valid?
153
- assert @klass.new("do", "example", "www").valid?
151
+ assert !@klass.new("ke").valid?
152
+ assert !@klass.new("ke", "example").valid?
153
+ assert @klass.new("ke", "example", "www").valid?
154
154
  end
155
155
 
156
156
  def test_valid_domain_question
@@ -58,8 +58,8 @@ class PublicSuffixServiceTest < Test::Unit::TestCase
58
58
  end
59
59
 
60
60
  def test_self_parse_should_raise_with_unallowed_domain
61
- error = assert_raise(PublicSuffixService::DomainNotAllowed) { PublicSuffixService.parse("example.do") }
62
- assert_match %r{example\.do}, error.message
61
+ error = assert_raise(PublicSuffixService::DomainNotAllowed) { PublicSuffixService.parse("example.ke") }
62
+ assert_match %r{example\.ke}, error.message
63
63
  end
64
64
 
65
65
 
data/test/test_helper.rb CHANGED
@@ -1,8 +1,8 @@
1
- $:.unshift(File.dirname(__FILE__) + '/../lib')
2
-
3
1
  require 'rubygems'
4
2
  require 'test/unit'
5
3
  require 'rr'
4
+
5
+ $:.unshift File.expand_path('../../lib', __FILE__)
6
6
  require 'public_suffix_service'
7
7
 
8
8
  class Test::Unit::TestCase
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: public_suffix_service
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.2
5
+ version: 0.8.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Simone Carletti
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-11 00:00:00 +01:00
14
- default_executable:
13
+ date: 2011-05-27 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rr
@@ -35,7 +34,7 @@ dependencies:
35
34
  type: :development
36
35
  prerelease: false
37
36
  version_requirements: *id002
38
- description: " Intelligent domain name parser based in the Public Suffix List. PublicSuffixService can parse and decompose a domain name into top level domain, domain and subdomains.\n"
37
+ description: PublicSuffixService can parse and decompose a domain name into top level domain, domain and subdomains.
39
38
  email: weppos@weppos.net
40
39
  executables: []
41
40
 
@@ -54,7 +53,7 @@ files:
54
53
  - README.md
55
54
  - Rakefile
56
55
  - lib/public_suffix_service.rb
57
- - lib/public_suffix_service/definitions.dat
56
+ - lib/public_suffix_service/definitions.txt
58
57
  - lib/public_suffix_service/domain.rb
59
58
  - lib/public_suffix_service/errors.rb
60
59
  - lib/public_suffix_service/rule.rb
@@ -68,7 +67,6 @@ files:
68
67
  - test/public_suffix_service/rule_test.rb
69
68
  - test/public_suffix_service_test.rb
70
69
  - test/test_helper.rb
71
- has_rdoc: true
72
70
  homepage: http://www.simonecarletti.com/code/public_suffix_service
73
71
  licenses: []
74
72
 
@@ -92,10 +90,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
90
  requirements: []
93
91
 
94
92
  rubyforge_project:
95
- rubygems_version: 1.6.1
93
+ rubygems_version: 1.8.4
96
94
  signing_key:
97
95
  specification_version: 3
98
- summary: Domain Name parser based on the Public Suffix List
96
+ summary: Domain name parser based in the Public Suffix List.
99
97
  test_files:
100
98
  - test/acceptance_test.rb
101
99
  - test/public_suffix_service/domain_test.rb