Skip to content
This repository
Browse code

whois.sk-nic.sk parser must support `DOM_EXP', `DOM_LNOT', `DOM_WARN'…

… statuses.
  • Loading branch information...
commit d07711e884f623ee06b1b066df2e263abd847874 1 parent 1418003
Simone Carletti authored August 05, 2011
2  CHANGELOG.rdoc
Source Rendered
@@ -32,6 +32,8 @@
32 32
 
33 33
 * FIXED: whois.cira.ca parser must support `unavailable' status (#102).
34 34
 
  35
+* FIXED: whois.sk-nic.sk parser must support `DOM_EXP', `DOM_LNOT', `DOM_WARN' statuses.
  36
+
35 37
 
36 38
 == Release 2.0.4
37 39
 
3  lib/whois/record/parser/whois.nic.it.rb
@@ -48,7 +48,8 @@ class WhoisNicIt < Base
48 48
           when "grace-period", "pendingupdate", "pendingtransfer", "no-provider"
49 49
             :registered
50 50
           when "pendingdelete / redemptionperiod", /redemption\-/,
51  
-               "pendingdelete / pendingdelete"  # will be deleted in 5 days
  51
+          # The domain will be deleted in 5 days
  52
+               "pendingdelete / pendingdelete"
52 53
             :redemption
53 54
           when "unassignable"
54 55
             :reserved
20  lib/whois/record/parser/whois.sk-nic.sk.rb
@@ -28,12 +28,26 @@ class Parser
28 28
       class WhoisSkNicSk < Base
29 29
 
30 30
         # @see https://www.sk-nic.sk/documents/stavy_domen.html
  31
+        # @see http://www.inwx.de/en/sk-domain.html
31 32
         property_supported :status do
32 33
           if content_for_scanner =~ /^Domain-status\s+(.+)\n/
33 34
             case $1.downcase
34  
-              when "dom_ok"   then :registered
35  
-              when "dom_held" then :registered
36  
-              when "dom_dakt" then :registered
  35
+              # The domain is registered and paid.
  36
+              when  "dom_ok",
  37
+              # Replacement 14-day period for domain payment.
  38
+                    "dom_dakt",
  39
+              # 28 days before the expiration of one year's notice is sent to the first call for an extension of domains.
  40
+              # The domain is still fully functional (14 days).
  41
+                    "dom_warn",
  42
+              # 14 days before the expiration of one year's notice is sent to the second call to the extension of domains.
  43
+              # The domain is still fully functional (14 days).
  44
+                    "dom_lnot",
  45
+              # The domain is expired and has not been renewed (14 days).
  46
+                    "dom_exp"
  47
+                :registered
  48
+              # The domain losts its registrar (28 days).
  49
+              when  "dom_held"
  50
+                :redemption
37 51
               else
38 52
                 Whois.bug!(ParserError, "Unknown status `#{$1}'.")
39 53
             end
8  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_exp.expected
... ...
@@ -0,0 +1,8 @@
  1
+#status
  2
+  should: %s == :registered
  3
+
  4
+#available?
  5
+  should: %s == false
  6
+
  7
+#registered?
  8
+  should: %s == true
27  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_exp.txt
... ...
@@ -0,0 +1,27 @@
  1
+%
  2
+% whois.sk-nic.sk - whois server for TLD .sk
  3
+%
  4
+
  5
+
  6
+Domain-name         kuphry.sk
  7
+Admin-id            BCPE-0006
  8
+Admin-name          Bc. Peter Drienovsky
  9
+Admin-legal-form    zivnost
  10
+Admin-org.-ID       40332721
  11
+Admin-address       Hviezdoslavova 22, Zlate Moravce 95301
  12
+Admin-telephone     +421 905 2398 07
  13
+Admin-email         peter@drienovsky.sk
  14
+Tech-id             BCPE-0006
  15
+Tech-name           Bc. Peter Drienovsky
  16
+Tech-org.-ID        40332721
  17
+Tech-address        Hviezdoslavova 22, Zlate Moravce 95301
  18
+Tech-telephone      +421 905 2398 07
  19
+Tech-email          peter@drienovsky.sk
  20
+dns_name            ns1.servage.net
  21
+dns_name            ns2.servage.net
  22
+dns_name            ns3.servage.net
  23
+dns_name            ns4.servage.net
  24
+Last-update         2011-08-02
  25
+Valid-date          2011-08-16
  26
+Domain-status       DOM_EXP
  27
+
2  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_held.expected
... ...
@@ -1,5 +1,5 @@
1 1
 #status
2  
-  should: %s == :registered
  2
+  should: %s == :redemption
3 3
 
4 4
 #available?
5 5
   should: %s == false
8  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_lnot.expected
... ...
@@ -0,0 +1,8 @@
  1
+#status
  2
+  should: %s == :registered
  3
+
  4
+#available?
  5
+  should: %s == false
  6
+
  7
+#registered?
  8
+  should: %s == true
26  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_lnot.txt
... ...
@@ -0,0 +1,26 @@
  1
+%
  2
+% whois.sk-nic.sk - whois server for TLD .sk
  3
+%
  4
+
  5
+
  6
+Domain-name         dobramasaz.sk
  7
+Admin-id            SECO-0007
  8
+Admin-name          SECORAMA
  9
+Admin-legal-form    s.r.o
  10
+Admin-org.-ID       45509859
  11
+Admin-address       Kresankova 7/B, Bratislava 84105
  12
+Admin-telephone     0000000000, 0000000000
  13
+Admin-email         hmalik@secorama.sk
  14
+Tech-id             FORP-0003
  15
+Tech-name           Forplay, spol. s r.o.
  16
+Tech-org.-ID        35868295
  17
+Tech-address        Laurinska 11, Bratislava - Stare mesto 811 01
  18
+Tech-telephone      0905 403 404
  19
+Tech-email          info@forplay.sk
  20
+dns_name            ns1.brianlurie.com
  21
+dns_name            ns2.brianlurie.com
  22
+dns_name            ns3.brianlurie.com
  23
+Last-update         2011-08-02
  24
+Valid-date          2011-08-16
  25
+Domain-status       DOM_LNOT
  26
+
8  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_warn.expected
... ...
@@ -0,0 +1,8 @@
  1
+#status
  2
+  should: %s == :registered
  3
+
  4
+#available?
  5
+  should: %s == false
  6
+
  7
+#registered?
  8
+  should: %s == true
24  spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_warn.txt
... ...
@@ -0,0 +1,24 @@
  1
+%
  2
+% whois.sk-nic.sk - whois server for TLD .sk
  3
+%
  4
+
  5
+
  6
+Domain-name         e-biznis.sk
  7
+Admin-id            EVEC-0001
  8
+Admin-name          eVector s.r.o.
  9
+Admin-legal-form    s.r.o
  10
+Admin-org.-ID       36552011
  11
+Admin-address       Coboriho 2, Nitra 94901
  12
+Admin-telephone     421-37-6578941
  13
+Admin-email         info@evector.sk
  14
+Tech-id             BEES-0002
  15
+Tech-name           BeeSoft s.r.o.
  16
+Tech-org.-ID        36723657
  17
+Tech-address        Lamacska cesta 20, Bratislava 84103
  18
+Tech-telephone      421264530707, 421905322795
  19
+dns_name            ns1.beesoft.sk
  20
+dns_name            ns2.beesoft.sk
  21
+Last-update         2011-07-30
  22
+Valid-date          2011-08-27
  23
+Domain-status       DOM_WARN
  24
+
39  spec/whois/record/parser/responses/whois.sk-nic.sk/property_status_dom_exp_spec.rb
... ...
@@ -0,0 +1,39 @@
  1
+# encoding: utf-8
  2
+
  3
+# This file is autogenerated. Do not edit it manually.
  4
+# If you want change the content of this file, edit
  5
+#
  6
+#   /spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_exp.expected
  7
+#
  8
+# and regenerate the tests with the following rake task
  9
+#
  10
+#   $ rake genspec:parsers
  11
+#
  12
+
  13
+require 'spec_helper'
  14
+require 'whois/record/parser/whois.sk-nic.sk.rb'
  15
+
  16
+describe Whois::Record::Parser::WhoisSkNicSk, "property_status_dom_exp.expected" do
  17
+
  18
+  before(:each) do
  19
+    file = fixture("responses", "whois.sk-nic.sk/property_status_dom_exp.txt")
  20
+    part = Whois::Record::Part.new(:body => File.read(file))
  21
+    @parser = klass.new(part)
  22
+  end
  23
+
  24
+  describe "#status" do
  25
+    it do
  26
+      @parser.status.should == :registered
  27
+    end
  28
+  end
  29
+  describe "#available?" do
  30
+    it do
  31
+      @parser.available?.should == false
  32
+    end
  33
+  end
  34
+  describe "#registered?" do
  35
+    it do
  36
+      @parser.registered?.should == true
  37
+    end
  38
+  end
  39
+end
2  spec/whois/record/parser/responses/whois.sk-nic.sk/property_status_dom_held_spec.rb
@@ -23,7 +23,7 @@
23 23
 
24 24
   describe "#status" do
25 25
     it do
26  
-      @parser.status.should == :registered
  26
+      @parser.status.should == :redemption
27 27
     end
28 28
   end
29 29
   describe "#available?" do
39  spec/whois/record/parser/responses/whois.sk-nic.sk/property_status_dom_lnot_spec.rb
... ...
@@ -0,0 +1,39 @@
  1
+# encoding: utf-8
  2
+
  3
+# This file is autogenerated. Do not edit it manually.
  4
+# If you want change the content of this file, edit
  5
+#
  6
+#   /spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_lnot.expected
  7
+#
  8
+# and regenerate the tests with the following rake task
  9
+#
  10
+#   $ rake genspec:parsers
  11
+#
  12
+
  13
+require 'spec_helper'
  14
+require 'whois/record/parser/whois.sk-nic.sk.rb'
  15
+
  16
+describe Whois::Record::Parser::WhoisSkNicSk, "property_status_dom_lnot.expected" do
  17
+
  18
+  before(:each) do
  19
+    file = fixture("responses", "whois.sk-nic.sk/property_status_dom_lnot.txt")
  20
+    part = Whois::Record::Part.new(:body => File.read(file))
  21
+    @parser = klass.new(part)
  22
+  end
  23
+
  24
+  describe "#status" do
  25
+    it do
  26
+      @parser.status.should == :registered
  27
+    end
  28
+  end
  29
+  describe "#available?" do
  30
+    it do
  31
+      @parser.available?.should == false
  32
+    end
  33
+  end
  34
+  describe "#registered?" do
  35
+    it do
  36
+      @parser.registered?.should == true
  37
+    end
  38
+  end
  39
+end
39  spec/whois/record/parser/responses/whois.sk-nic.sk/property_status_dom_warn_spec.rb
... ...
@@ -0,0 +1,39 @@
  1
+# encoding: utf-8
  2
+
  3
+# This file is autogenerated. Do not edit it manually.
  4
+# If you want change the content of this file, edit
  5
+#
  6
+#   /spec/fixtures/responses/whois.sk-nic.sk/property_status_dom_warn.expected
  7
+#
  8
+# and regenerate the tests with the following rake task
  9
+#
  10
+#   $ rake genspec:parsers
  11
+#
  12
+
  13
+require 'spec_helper'
  14
+require 'whois/record/parser/whois.sk-nic.sk.rb'
  15
+
  16
+describe Whois::Record::Parser::WhoisSkNicSk, "property_status_dom_warn.expected" do
  17
+
  18
+  before(:each) do
  19
+    file = fixture("responses", "whois.sk-nic.sk/property_status_dom_warn.txt")
  20
+    part = Whois::Record::Part.new(:body => File.read(file))
  21
+    @parser = klass.new(part)
  22
+  end
  23
+
  24
+  describe "#status" do
  25
+    it do
  26
+      @parser.status.should == :registered
  27
+    end
  28
+  end
  29
+  describe "#available?" do
  30
+    it do
  31
+      @parser.available?.should == false
  32
+    end
  33
+  end
  34
+  describe "#registered?" do
  35
+    it do
  36
+      @parser.registered?.should == true
  37
+    end
  38
+  end
  39
+end
4  whois.gemspec
2 additions, 2 deletions not shown

0 notes on commit d07711e

Please sign in to comment.
Something went wrong with that request. Please try again.