diff --git a/lib/whois/record/parser/whois.ripn.net.rb b/lib/whois/record/parser/whois.ripn.net.rb index 7311c6312..111f5c494 100644 --- a/lib/whois/record/parser/whois.ripn.net.rb +++ b/lib/whois/record/parser/whois.ripn.net.rb @@ -67,15 +67,14 @@ class WhoisRipnNet < Base property_supported :admin_contacts do - if content_for_scanner =~ /e-mail:\s+(.+)\n/ + content_for_scanner.scan(/e-mail:\s+(.+)\n/).flatten.map do |email| Record::Contact.new( :type => Record::Contact::TYPE_ADMIN, :name => content_for_scanner[/person:\s+(.+)\n/, 1], :organization => content_for_scanner[/org:\s+(.+)\n/, 1], :phone => content_for_scanner[/phone:\s+(.+)\n/, 1], :fax => content_for_scanner[/fax-no:\s+(.+)\n/, 1], - # Return the first matched email, even if there are a few of them - :email => content_for_scanner[/e-mail:\s+(.+)\n/, 1] + :email => email ) end end diff --git a/spec/fixtures/responses/whois.ripn.net/ru/status_registered.expected b/spec/fixtures/responses/whois.ripn.net/ru/status_registered.expected index 2a6624513..ab6c6da56 100644 --- a/spec/fixtures/responses/whois.ripn.net/ru/status_registered.expected +++ b/spec/fixtures/responses/whois.ripn.net/ru/status_registered.expected @@ -31,7 +31,7 @@ #admin_contacts should: %s be_a(Array) - should: %s have(1).items + should: %s have(2).items should: %s[0] be_a(_contact) should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN should: %s[0].id == nil @@ -40,6 +40,13 @@ should: %s[0].phone == "+1 650 330 0100" should: %s[0].fax == "+1 650 618 8571" should: %s[0].email == "dns-admin@google.com" + should: %s[1].type == Whois::Record::Contact::TYPE_ADMIN + should: %s[1].id == nil + should: %s[1].name == nil + should: %s[1].organization == "Google Inc" + should: %s[1].phone == "+1 650 330 0100" + should: %s[1].fax == "+1 650 618 8571" + should: %s[1].email == "ccops@markmonitor.com" #technical_contacts should: %s raise_error(Whois::PropertyNotSupported) diff --git a/spec/whois/record/parser/responses/whois.ripn.net/ru/status_registered_spec.rb b/spec/whois/record/parser/responses/whois.ripn.net/ru/status_registered_spec.rb index 4fb21c420..5aaaefa36 100644 --- a/spec/whois/record/parser/responses/whois.ripn.net/ru/status_registered_spec.rb +++ b/spec/whois/record/parser/responses/whois.ripn.net/ru/status_registered_spec.rb @@ -69,7 +69,7 @@ context "#admin_contacts" do it do @parser.admin_contacts.should be_a(Array) - @parser.admin_contacts.should have(1).items + @parser.admin_contacts.should have(2).items @parser.admin_contacts[0].should be_a(_contact) @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN @parser.admin_contacts[0].id.should == nil @@ -78,6 +78,13 @@ @parser.admin_contacts[0].phone.should == "+1 650 330 0100" @parser.admin_contacts[0].fax.should == "+1 650 618 8571" @parser.admin_contacts[0].email.should == "dns-admin@google.com" + @parser.admin_contacts[1].type.should == Whois::Record::Contact::TYPE_ADMIN + @parser.admin_contacts[1].id.should == nil + @parser.admin_contacts[1].name.should == nil + @parser.admin_contacts[1].organization.should == "Google Inc" + @parser.admin_contacts[1].phone.should == "+1 650 330 0100" + @parser.admin_contacts[1].fax.should == "+1 650 618 8571" + @parser.admin_contacts[1].email.should == "ccops@markmonitor.com" end end context "#technical_contacts" do