lib/whois/parsers/whois.dns.be.rb in whois-parser-1.2.0 vs lib/whois/parsers/whois.dns.be.rb in whois-parser-2.0.0
- old
+ new
@@ -1,11 +1,11 @@
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
-# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
+# Copyright (c) 2009-2022 Simone Carletti <weppos@weppos.net>
#++
require_relative 'base'
@@ -29,11 +29,11 @@
end
property_supported :status do
if content_for_scanner =~ /Status:\s+(.+?)\n/
- case $1.downcase
+ case ::Regexp.last_match(1).downcase
when "available"
:available
when "not available"
:registered
when "quarantine"
@@ -41,11 +41,11 @@
when "out of service"
:redemption
when "not allowed"
:invalid
else
- Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
+ Whois::Parser.bug!(ParserError, "Unknown status `#{::Regexp.last_match(1)}'.")
end
else
Whois::Parser.bug!(ParserError, "Unable to parse status.")
end
end
@@ -59,11 +59,11 @@
end
property_supported :created_on do
if content_for_scanner =~ /Registered:\s+(.+)\n/
- parse_time($1)
+ parse_time(::Regexp.last_match(1))
end
end
property_not_supported :updated_on
@@ -78,12 +78,12 @@
end
property_supported :nameservers do
if content_for_scanner =~ /Nameservers:\s((.+\n)+)\n/
- $1.split("\n").map do |line|
+ ::Regexp.last_match(1).split("\n").map do |line|
if line.strip =~ /(.+) \((.+)\)/
- Parser::Nameserver.new(:name => $1, :ipv4 => $2)
+ Parser::Nameserver.new(:name => ::Regexp.last_match(1), :ipv4 => ::Regexp.last_match(2))
else
Parser::Nameserver.new(:name => line.strip)
end
end
end