Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trim_newline => trim_empty_line

  • Loading branch information...
commit 3788bc42f274e0dde85cca8fad108f170bd1dbae 1 parent 908a076
Simone Carletti authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/whois/answer/parser/whois.publicinterestregistry.net.rb
12 lib/whois/answer/parser/whois.publicinterestregistry.net.rb
View
@@ -30,7 +30,7 @@ class WhoisPublicinterestregistryNet < Base
include Ast
property_supported :disclaimer do
- @disclaimer ||= node("Disclaimer")
+ @disclaimer ||= node("disclaimer")
end
@@ -168,7 +168,7 @@ def parse
private
def parse_content
- trim_newline ||
+ trim_empty_line ||
parse_not_found ||
parse_throttle ||
parse_disclaimer ||
@@ -176,8 +176,8 @@ def parse_content
error("Unexpected token")
end
- def trim_newline
- @input.skip(/\n+/)
+ def trim_empty_line
+ @input.skip(/^\n/)
end
def parse_not_found
@@ -197,14 +197,14 @@ def parse_disclaimer
while !@input.match?(/\n/) && @input.scan(/(.*)\n/)
lines << @input[1].strip
end
- @ast["Disclaimer"] = lines.join(" ")
+ @ast["disclaimer"] = lines.join(" ")
else
false
end
end
def parse_pair
- if @input.scan(/(.*?):(.*?)\n/)
+ if @input.scan(/(.+?):(.*?)\n/)
key, value = @input[1].strip, @input[2].strip
if @ast[key].nil?
@ast[key] = value
Please sign in to comment.
Something went wrong with that request. Please try again.