From 01b16184324b19a998fe3e82932d3f6fcabdef80 Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 13:59:24 +0300 Subject: [PATCH 1/7] Update rotld whois --- lib/whois/parsers/whois.rotld.ro.rb | 16 +++++---- .../ro/status_available.expected | 8 ++--- .../ro/status_registered.expected | 10 +++--- .../whois.rotld.ro/ro/status_registered.txt | 36 +++++++++---------- 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/lib/whois/parsers/whois.rotld.ro.rb b/lib/whois/parsers/whois.rotld.ro.rb index 9c8aa41d..aab13c62 100644 --- a/lib/whois/parsers/whois.rotld.ro.rb +++ b/lib/whois/parsers/whois.rotld.ro.rb @@ -45,13 +45,17 @@ class WhoisRotldRo < Base !available? end + property_supported :expires_on do + if content_for_scanner =~ /Expires On:\s+(.+?)\n/ + parse_time($1) + end + end - property_not_supported :created_on - - property_not_supported :updated_on - - property_not_supported :expires_on - + property_supported :created_on do + if content_for_scanner =~ /created:\s+(.+?)\n/ + parse_time($1) + end + end property_supported :nameservers do content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name| diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index 982cebd7..c6dde9b1 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -9,14 +9,10 @@ #created_on - %s %ERROR{AttributeNotSupported} - -#updated_on - %s %ERROR{AttributeNotSupported} + %s == nil #expires_on - %s %ERROR{AttributeNotSupported} - + %s == nil #nameservers %s %CLASS{array} diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index a287bbdc..82a8f1ed 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -9,14 +9,12 @@ #created_on - %s %ERROR{AttributeNotSupported} - -#updated_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-17} #expires_on - %s %ERROR{AttributeNotSupported} - + %s %CLASS{time} + %s %TIME{2018-09-17} #nameservers %s %CLASS{array} diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt index fb084973..6813959c 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt @@ -1,22 +1,24 @@ - -% Whois Server Version 3.0 - whois.rotld.ro:43 - -% Rights restricted by copyright. -% Specifically, this data MAY ONLY be used for Internet operational -% purposes. It may not be used for targeted advertising or any -% other purpose. - -% Este INTERZISA folosirea datelor de pe acest server in oricare -% alt scop decat operarea retelei. In special este INTERZISA -% folosirea lor in scopuri publicitare. - -% Top Level Domain : ro -% Maintainance : www.rotld.ro - +% Whois Server Version 3.0 - whois.rotld.ro:43 + +% Rights restricted by copyright. +% Specifically, this data MAY ONLY be used for Internet operational +% purposes. It may not be used for targeted advertising or any +% other purpose. + +% Este INTERZISA folosirea datelor de pe acest server in oricare +% alt scop decat operarea retelei. In special este INTERZISA +% folosirea lor in scopuri publicitare. + +% Top Level Domain : ro +% Maintainance : www.rotld.ro + Domain Name: google.ro Registered On: 2000-07-17 + Expires On: 2018-09-17 Registrar: MarkMonitor Inc. - Referral URL: http://www.markmonitor.com + Referral URL: www.markmonitor.com + + DNSSEC: Inactive Nameserver: ns1.google.com Nameserver: ns2.google.com @@ -24,5 +26,3 @@ Nameserver: ns4.google.com Domain Status: UpdateProhibited - - From 6bd2e8e2faae767426a4658cdb22562ad9d2d079 Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 14:26:38 +0300 Subject: [PATCH 2/7] Fix later update --- lib/whois/parsers/whois.rotld.ro.rb | 4 +++- .../responses/whois.rotld.ro/ro/status_available.expected | 3 +++ .../responses/whois.rotld.ro/ro/status_registered.expected | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/whois/parsers/whois.rotld.ro.rb b/lib/whois/parsers/whois.rotld.ro.rb index aab13c62..46701c45 100644 --- a/lib/whois/parsers/whois.rotld.ro.rb +++ b/lib/whois/parsers/whois.rotld.ro.rb @@ -52,11 +52,13 @@ class WhoisRotldRo < Base end property_supported :created_on do - if content_for_scanner =~ /created:\s+(.+?)\n/ + if content_for_scanner =~ /Registered On:\s+(.+?)\n/ parse_time($1) end end + property_not_supported :updated_on + property_supported :nameservers do content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name| Parser::Nameserver.new(name: name) diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index c6dde9b1..e7c4a219 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -10,6 +10,9 @@ #created_on %s == nil + +#updated_on + %s %ERROR{AttributeNotSupported} #expires_on %s == nil diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index 82a8f1ed..5d86573e 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -11,6 +11,9 @@ #created_on %s %CLASS{time} %s %TIME{2000-07-17} + +#updated_on + %s %ERROR{AttributeNotSupported} #expires_on %s %CLASS{time} From cb79ed9ec28b217a79254d1f7391ac948576accd Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 16:24:56 +0300 Subject: [PATCH 3/7] Add tests --- lib/whois/parsers/whois.rotld.ro.rb | 1 + .../ro/status_available.expected | 9 ++--- .../ro/status_registered.expected | 11 +++--- .../whois.rotld.ro/ro/status_registered.txt | 36 +++++++++---------- .../ro/status_available_spec.rb | 4 +-- .../ro/status_registered_spec.rb | 4 +-- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/lib/whois/parsers/whois.rotld.ro.rb b/lib/whois/parsers/whois.rotld.ro.rb index 46701c45..39809182 100644 --- a/lib/whois/parsers/whois.rotld.ro.rb +++ b/lib/whois/parsers/whois.rotld.ro.rb @@ -59,6 +59,7 @@ class WhoisRotldRo < Base property_not_supported :updated_on + property_supported :nameservers do content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name| Parser::Nameserver.new(name: name) diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index e7c4a219..982cebd7 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -9,13 +9,14 @@ #created_on - %s == nil - -#updated_on + %s %ERROR{AttributeNotSupported} + +#updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s == nil + %s %ERROR{AttributeNotSupported} + #nameservers %s %CLASS{array} diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index 5d86573e..a287bbdc 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -9,15 +9,14 @@ #created_on - %s %CLASS{time} - %s %TIME{2000-07-17} - -#updated_on + %s %ERROR{AttributeNotSupported} + +#updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s %CLASS{time} - %s %TIME{2018-09-17} + %s %ERROR{AttributeNotSupported} + #nameservers %s %CLASS{array} diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt index 6813959c..fb084973 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt @@ -1,24 +1,22 @@ -% Whois Server Version 3.0 - whois.rotld.ro:43 - -% Rights restricted by copyright. -% Specifically, this data MAY ONLY be used for Internet operational -% purposes. It may not be used for targeted advertising or any -% other purpose. - -% Este INTERZISA folosirea datelor de pe acest server in oricare -% alt scop decat operarea retelei. In special este INTERZISA -% folosirea lor in scopuri publicitare. - -% Top Level Domain : ro -% Maintainance : www.rotld.ro - + +% Whois Server Version 3.0 - whois.rotld.ro:43 + +% Rights restricted by copyright. +% Specifically, this data MAY ONLY be used for Internet operational +% purposes. It may not be used for targeted advertising or any +% other purpose. + +% Este INTERZISA folosirea datelor de pe acest server in oricare +% alt scop decat operarea retelei. In special este INTERZISA +% folosirea lor in scopuri publicitare. + +% Top Level Domain : ro +% Maintainance : www.rotld.ro + Domain Name: google.ro Registered On: 2000-07-17 - Expires On: 2018-09-17 Registrar: MarkMonitor Inc. - Referral URL: www.markmonitor.com - - DNSSEC: Inactive + Referral URL: http://www.markmonitor.com Nameserver: ns1.google.com Nameserver: ns2.google.com @@ -26,3 +24,5 @@ Nameserver: ns4.google.com Domain Status: UpdateProhibited + + diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb index f67eef3b..0cd5abf8 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_available_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(nil) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(nil) end end describe "#nameservers" do diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb index bf6e20a6..6ce84937 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0300")) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0300")) end end describe "#nameservers" do From 5eb1ade8e6dbf6d5c18c31e504a527f5c5d67dd0 Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 16:40:42 +0300 Subject: [PATCH 4/7] Add tests fix --- .../responses/whois.rotld.ro/ro/status_registered_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb index 6ce84937..21b77187 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0300")) + expect(subject.created_on).to eq(Time.parse("2000-07-16 21:00:00.000000000 +0000")) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0300")) + expect(subject.created_on).to eq(Time.parse("2000-07-16 21:00:00.000000000 +0000")) end end describe "#nameservers" do From 2527c26ef5a7362a9ede92a413e40d6b784a148d Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 16:57:06 +0300 Subject: [PATCH 5/7] Add tests fix 2 --- .../ro/status_available.expected | 6 ++-- .../ro/status_registered.expected | 6 ++-- .../whois.rotld.ro/ro/status_registered.txt | 29 ++++++++++--------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index 982cebd7..8d90a375 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -9,13 +9,15 @@ #created_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-16 21:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-16 21:00:00.000000000 +0000} #nameservers diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index a287bbdc..7c348689 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -9,13 +9,15 @@ #created_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-16 21:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2000-07-16 21:00:00.000000000 +0000} #nameservers diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt index fb084973..dc987ca1 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.txt @@ -13,16 +13,19 @@ % Top Level Domain : ro % Maintainance : www.rotld.ro - Domain Name: google.ro - Registered On: 2000-07-17 - Registrar: MarkMonitor Inc. - Referral URL: http://www.markmonitor.com - - Nameserver: ns1.google.com - Nameserver: ns2.google.com - Nameserver: ns3.google.com - Nameserver: ns4.google.com - - Domain Status: UpdateProhibited - - + Domain Name: google.ro + Registered On: 2000-07-17 + Expires On: 2018-09-17 + Registrar: MarkMonitor Inc. + Referral URL: www.markmonitor.com + + DNSSEC: Inactive + + Nameserver: ns1.google.com + Nameserver: ns2.google.com + Nameserver: ns3.google.com + Nameserver: ns4.google.com + + Domain Status: UpdateProhibited + + From 16210af7989d9c28ab75288257084b26ac0d3afb Mon Sep 17 00:00:00 2001 From: "petrescu_razvan_ioan@yahoo.com" Date: Fri, 29 Jun 2018 17:07:27 +0300 Subject: [PATCH 6/7] Add tests fix 3 --- .../ro/property_status_updateprohibited.txt | 29 ++++++++++--------- .../ro/status_available.expected | 4 +-- .../ro/status_registered.expected | 4 +-- .../ro/status_registered_spec.rb | 4 +-- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt b/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt index 02416369..dc987ca1 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt +++ b/spec/fixtures/responses/whois.rotld.ro/ro/property_status_updateprohibited.txt @@ -13,16 +13,19 @@ % Top Level Domain : ro % Maintainance : www.rotld.ro - Domain Name: google.ro - Registered On: 2000-07-17 - Registrar: MarkMonitor Inc. - Referral URL: - - Nameserver: ns4.google.com - Nameserver: ns1.google.com - Nameserver: ns3.google.com - Nameserver: ns2.google.com - - Domain Status: UpdateProhibited - - + Domain Name: google.ro + Registered On: 2000-07-17 + Expires On: 2018-09-17 + Registrar: MarkMonitor Inc. + Referral URL: www.markmonitor.com + + DNSSEC: Inactive + + Nameserver: ns1.google.com + Nameserver: ns2.google.com + Nameserver: ns3.google.com + Nameserver: ns4.google.com + + Domain Status: UpdateProhibited + + diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected index 8d90a375..47ed7904 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_available.expected @@ -10,14 +10,14 @@ #created_on %s %CLASS{time} - %s %TIME{2000-07-16 21:00:00.000000000 +0000} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on %s %CLASS{time} - %s %TIME{2000-07-16 21:00:00.000000000 +0000} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #nameservers diff --git a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected index 7c348689..ca131cc6 100644 --- a/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected +++ b/spec/fixtures/responses/whois.rotld.ro/ro/status_registered.expected @@ -10,14 +10,14 @@ #created_on %s %CLASS{time} - %s %TIME{2000-07-16 21:00:00.000000000 +0000} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #updated_on %s %ERROR{AttributeNotSupported} #expires_on %s %CLASS{time} - %s %TIME{2000-07-16 21:00:00.000000000 +0000} + %s %TIME{2000-07-17 00:00:00.000000000 +0000} #nameservers diff --git a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb index 21b77187..9c4d7ee7 100644 --- a/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb +++ b/spec/whois/parsers/responses/whois.rotld.ro/ro/status_registered_spec.rb @@ -38,7 +38,7 @@ end describe "#created_on" do it do - expect(subject.created_on).to eq(Time.parse("2000-07-16 21:00:00.000000000 +0000")) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000")) end end describe "#updated_on" do @@ -48,7 +48,7 @@ end describe "#expires_on" do it do - expect(subject.created_on).to eq(Time.parse("2000-07-16 21:00:00.000000000 +0000")) + expect(subject.created_on).to eq(Time.parse("2000-07-17 00:00:00.000000000 +0000")) end end describe "#nameservers" do From ff4b12d95c1c29ed3d2cb5577d41bed65fb59a14 Mon Sep 17 00:00:00 2001 From: 0x01 Date: Mon, 22 Jul 2019 13:10:26 +0300 Subject: [PATCH 7/7] Update whois.rotld.ro.rb Sort property definition --- lib/whois/parsers/whois.rotld.ro.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/whois/parsers/whois.rotld.ro.rb b/lib/whois/parsers/whois.rotld.ro.rb index 39809182..63ff47cd 100644 --- a/lib/whois/parsers/whois.rotld.ro.rb +++ b/lib/whois/parsers/whois.rotld.ro.rb @@ -45,12 +45,6 @@ class WhoisRotldRo < Base !available? end - property_supported :expires_on do - if content_for_scanner =~ /Expires On:\s+(.+?)\n/ - parse_time($1) - end - end - property_supported :created_on do if content_for_scanner =~ /Registered On:\s+(.+?)\n/ parse_time($1) @@ -59,6 +53,11 @@ class WhoisRotldRo < Base property_not_supported :updated_on + property_supported :expires_on do + if content_for_scanner =~ /Expires On:\s+(.+?)\n/ + parse_time($1) + end + end property_supported :nameservers do content_for_scanner.scan(/Nameserver:\s+(.+)\n/).flatten.map do |name|