lib/whois/parsers/whois.nic.tr.rb in whois-parser-1.2.0 vs lib/whois/parsers/whois.nic.tr.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'
@@ -48,20 +48,20 @@
end
property_supported :created_on do
if content_for_scanner =~ /Created on\.+:\s+(.+)\n/
- time = parse_time($1)
+ time = parse_time(::Regexp.last_match(1))
Time.utc(time.year, time.month, time.day)
end
end
property_not_supported :updated_on
property_supported :expires_on do
if content_for_scanner =~ /Expires on\.+:\s+(.+)\n/
- time = parse_time($1)
+ time = parse_time(::Regexp.last_match(1))
Time.utc(time.year, time.month, time.day)
end
end
@@ -74,15 +74,15 @@
lines = textblock.lines.map(&:strip)
name = lines[0]
address = lines[1..2].delete_if(&:blank?).join("\n")
- city, country = if (lines[3] == "Out of Turkey,")
- [nil, lines[4]]
- else
- [lines[3].chomp(","), lines[4]]
- end
+ city, country = if lines[3] == "Out of Turkey,"
+ [nil, lines[4]]
+ else
+ [lines[3].chomp(","), lines[4]]
+ end
Parser::Contact.new(
type: Parser::Contact::TYPE_REGISTRANT,
name: name,
address: address,
@@ -103,11 +103,11 @@
end
property_supported :nameservers do
if content_for_scanner =~ /Domain Servers:\n((.+\n)+)\n/
- $1.split("\n").map do |line|
+ ::Regexp.last_match(1).split("\n").map do |line|
name, ipv4 = line.split(/\s+/)
Parser::Nameserver.new(:name => name, :ipv4 => ipv4)
end
end
end
@@ -138,10 +138,10 @@
lines.last.last << "\n" << line.strip
else
lines << line.match(/([^\t]+)\t+:\s+(.+)/).to_a[1..2]
end
end
- lines = Hash[lines]
+ lines = lines.to_h
Parser::Contact.new(
type: type,
id: lines["NIC Handle"],
name: lines["Person"],