lib/whois/parsers/whois.eu.rb in whois-parser-1.2.0 vs lib/whois/parsers/whois.eu.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'
@@ -17,11 +17,11 @@
#
class WhoisEu < Base
property_supported :domain do
if content_for_scanner =~ /Domain:\s+(.+)\n/
- "#{$1.downcase}"
+ "#{::Regexp.last_match(1).downcase}"
end
end
property_not_supported :domain_id
@@ -50,11 +50,11 @@
property_not_supported :expires_on
property_supported :registrar do
if content_for_scanner =~ /Registrar:\s((.+\n)+)\n/
- lines = $1
+ lines = ::Regexp.last_match(1)
Parser::Registrar.new(
name: lines.slice(/Name:\s+(.+)/, 1),
url: lines.slice(/Website:\s+(.+)/, 1)
)
end
@@ -74,11 +74,11 @@
# Fax: +1.6506188571
# Email: dns-admin@google.com
#
property_supported :technical_contacts do
if content_for_scanner =~ /Technical:\s((.+\n)+)\n/
- lines = $1
+ lines = ::Regexp.last_match(1)
Parser::Contact.new(
:type => Parser::Contact::TYPE_TECHNICAL,
:id => nil,
:name => lines.slice(/Name:\s*(.*)/, 1),
:organization => lines.slice(/Organisation:\s*(.*)/, 1),
@@ -100,12 +100,12 @@
# dns1.servicemagic.eu (91.121.133.61)
# dns2.servicemagic.eu (91.121.103.77)
#
property_supported :nameservers do
if content_for_scanner =~ /Name\sservers:\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