Skip to content

Commit

Permalink
Merge pull request #13 from infertux/non-ascii-whois
Browse files Browse the repository at this point in the history
Handle non-ASCII characters in WHOIS responses
  • Loading branch information
jpf committed Aug 31, 2012
2 parents 555f3db + 2bd1fbb commit 4e027ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/domain-profiler/whois.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

class Whois
def parse(data)
@data = data.to_s.split("\n")
@data = data.to_s.lines
# com = verisign
# net = verisign
# org = pir
Expand Down
6 changes: 6 additions & 0 deletions spec/whois/whois_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
whois.registrar.should == ['Unknown']
end

it "is able to deal with non-ASCII string input" do
whois = Whois.new
whois.parse("\xEA")
whois.registrar.should == ['Unknown']
end

it "knows when the domain expires" do
@zombo.expires.should == '10-oct-2010'
end
Expand Down

0 comments on commit 4e027ce

Please sign in to comment.