lib/webrobots/robotstxt.rb in webrobots-0.0.9 vs lib/webrobots/robotstxt.rb in webrobots-0.0.10
- old
+ new
@@ -44,10 +44,10 @@
string = input.respond_to?(:read) ? input.read : input
s = StringScanner.new(string)
value_expected = false
until s.eos?
- if t = s.scan(/[ \t]*\r?\n/)
+ if t = s.scan(/[ \t]*(?:\r?\n|\z)/)
if value_expected
@q << [:VALUE, '']
end
@q << [:EOL, t]
value_expected = false