lib/whois/parsers/whois.nic.bj.rb in whois-parser-1.2.0 vs lib/whois/parsers/whois.nic.bj.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_afilias' @@ -24,11 +24,11 @@ property_not_supported :disclaimer property_supported :domain do if section =~ /Domain Name:\s+(.+)\n/ - $1 + ::Regexp.last_match(1) end end property_not_supported :domain_id @@ -50,17 +50,17 @@ end property_supported :created_on do if section =~ /Created:\s+(.+)\n/ - parse_time($1) + parse_time(::Regexp.last_match(1)) end end property_supported :updated_on do if section =~ /Updated:\s+(.+)\n/ - parse_time($1) + parse_time(::Regexp.last_match(1)) end end property_not_supported :expires_on @@ -70,11 +70,11 @@ property_supported :registrant_contacts do if section =~ /Name:\s+(.+)\n/ Parser::Contact.new( type: Parser::Contact::TYPE_REGISTRANT, - name: $1 + name: ::Regexp.last_match(1) ) end end property_not_supported :admin_contacts @@ -82,23 +82,23 @@ property_not_supported :technical_contacts property_supported :nameservers do (1..4).map do |i| - section =~ /Name Server #{i}:\s+(.+)\n/ ? Parser::Nameserver.new(name: $1) : nil + section =~ /Name Server #{i}:\s+(.+)\n/ ? Parser::Nameserver.new(name: ::Regexp.last_match(1)) : nil end.compact end private def build_contact(element, type) node("#{element} ID") do - address = ["", "2", "3"]. - map { |i| node("#{element} Address#{i}") }. - delete_if(&:empty?). - join("\n") + address = ["", "2", "3"] + .map { |i| node("#{element} Address#{i}") } + .delete_if(&:empty?) + .join("\n") Parser::Contact.new( :type => type, :id => node("#{element} ID"), :name => node("#{element} Name"), @@ -115,10 +115,11 @@ end end def section return @section if @section - @section = content_for_scanner =~ /((?:Domain:.+\n)(?:.+:.+\n)+)\n/ ? $1 : "" + + @section = content_for_scanner =~ /((?:Domain:.+\n)(?:.+:.+\n)+)\n/ ? ::Regexp.last_match(1) : "" end end end