asenchi / scrolls

Simple logging
MIT License
158 stars 26 forks source link

Parser.parse doesn't handle empty values at end of line #63

Closed btoews closed 6 years ago

btoews commented 10 years ago

I ran into this while trying to parse some logs:

irb(main):004:0* Scrolls::Parser.parse 'foo='
=> {:foo==>nil}

It seems like the output should be:

{:foo => nil}
btoews commented 10 years ago

Looks like there might be some other bugs parsing the last element in the line:

irb(main):009:0* Scrolls::Parser.parse 'login=\"happy wheels game"'
=> {:login=>"\"happy", :wheels=>nil, :"game\""=>nil}
asenchi commented 10 years ago

Interesting, the tests around parsing are definitely sparse. I'll look at getting a patch together, thanks for the report.

btoews commented 6 years ago

Closing as stale.