Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Avoid hitting ArgumentError for parsing integers and floats. #98

Closed
wants to merge 1 commit into
from

Conversation

2 participants
Contributor

headius commented Nov 2, 2012

This patch is not quite perfect. There are cases that Integer and
Float handle that this does not, and the to_i and to_f methods
have the annoying tendency to ignore unparsable sections of the
string. We may just need to write a simple Ruby version of integer
and float parsing to use here. I'd be very surprised if it didn't
still balance out with regards to the exception-rescuing logic.

Avoid hitting ArgumentError for parsing integers and floats.
This patch is not quite perfect. There are cases that Integer and
Float handle that this does not, and the to_i and to_f methods
have the annoying tendency to ignore unparsable sections of the
string. We may just need to write a simple Ruby version of integer
and float parsing to use here. I'd be very surprised if it didn't
still balance out with regards to the exception-rescuing logic.
Contributor

headius commented Nov 2, 2012

The build failure is expected. It appears to fail handling things like hexadecimal integers, etc. In line with expectations for my minimal patch.

Owner

tenderlove commented Nov 3, 2012

Cool, thanks. I can work with it from here.

Owner

tenderlove commented Nov 17, 2012

Hey @headius, I fixed this in 9d7be25

Thanks!

@tenderlove tenderlove closed this Nov 17, 2012

Contributor

headius commented Nov 17, 2012

Excellent! I just pulled in updated .rb from psych master for JRuby 1.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment