qbwc / qbxml

QBXML Parser and Validation Tool
MIT License
27 stars 41 forks source link

Handle parsing of % character in a float type #19

Closed jhmoore closed 8 years ago

jhmoore commented 8 years ago

We've encountered a couple cases where a customer's Item query can come back with a string containing an actual % character in a percentage field, which is specified as a float type.

Passing a value of "18.0%" to Float() blows up with a (technically very correct) exception of ArgumentError: invalid value for Float(): "18.0%".

Using "18.0%".to_f instead simply stops parsing when it encounters a non-valid character, and returns 18.0.

jhmoore commented 8 years ago

It may also be worth mentioning that at first I tried adding a response fixture to the xml files contained in /spec/support, but they appear to no longer be used (and the rspec tests using them appear to be no longer working).

jhmoore commented 8 years ago

Also the tests pass when run locally, but it looks like the Travis builds are failing when trying to bundle.

Gem::InstallError: activesupport requires Ruby version >= 2.2.2.

bobby1190 commented 8 years ago

@jhmoore whats the status of https://www.pivotaltracker.com/story/show/126143139

JasonBarnabe commented 8 years ago

This is causing build failures due to an unrelated issue (though one that was exposed by your changes). Looks like some time zone issue.

https://travis-ci.org/qbwc/qbxml/builds/152547688

naomiajacobs commented 8 years ago

@JasonBarnabe it looks like current master for this is green - do you know when this fix will be released as a new gem version? Thanks!

// cc@bobbby1190 @jhmoore

naomiajacobs commented 7 years ago

@JasonBarnabe any update on this?

// cc @bobby1190 @jhmoore

JasonBarnabe commented 7 years ago

If you have used or tested the current master and it works, please comment in #22. I have not personally had a chance to test it yet.

naomiajacobs commented 7 years ago

@JasonBarnabe we haven't used master since it hasn't been published yet (for various reasons we can't point to the sha, we need the published version). Per #22, will there be no release until you hear from people who have used it?

JasonBarnabe commented 7 years ago

There will be no release until it's tested. Whether it's by me or someone else.

naomiajacobs commented 7 years ago

Hi @JasonBarnabe, checking in again to see if there are any plans to release the master version as part of the gem? Thanks!

racerpeter commented 7 years ago

@JasonBarnabe looks like we're going to fork qbxml to get this fix out for one of our customers. We'll let you know when its in production so that you can release it if desired.

JasonBarnabe commented 7 years ago

Yes, I'd be happy to release once I hear it's working properly in the real world.