remove the need for space between number and units#16
remove the need for space between number and units#16twalpole wants to merge 1 commit intoolbrich:masterfrom
Conversation
|
I've been testing this out and so far it seems pretty solid. There are a couple of cases where the units don't parse properly (like when the unit is something like "1 1/s"). |
|
I get the same results for Unit.new("1 1/s") with and without this change - scalar=1 units="1/s" - what result would you expect from it? Also it passed all the specs, so if there are things that its not parsing properly I will add specs for those |
|
My point is that Unit.new("11/s") doesn't work well. |
|
I get the same results for Unit.new("11/s") on both the master branch and the branch including my change. scalar=11 unit=1/s - this is using ruby 1.8.7-p174 - Are you seeing different results, or should the results be different than what I'm seeing? I'm more than willing to fix any issues if you will just point out specifically what issue you're finding - thanks |
|
I would expect that the scalar on that should be 1, not 11. Although this gets ambiguous as "11/m" is a valid way to express "11 1/m". specify { Unit("11/m").should == Unit('1 1/m')} |
|
Okay, but then this fails on master without the change I propsed too, |
|
I don't know if it is related but I also have a stack level too deep error in the following cases: Unit test (puts is needed to trigger the failure) In irb console, failure occurs with: |
|
Yep - thats the issue this change fixes On Fri, Jul 29, 2011 at 9:35 AM, gentooboontoo
|
|
Thanks. Your change seems correct. '1.5m' is perfectly valid but it fails with IRB and under some conditions I can't reproduce in a test without a 'puts'. |
…nd off errors and fixes olbrich#16
|
Hi, bug is still here:
Any chances on pulling this up? |
Remove the need for space between number and units, otherwise things like Unit.new("1.4g") throw a stack level too deep error. The requirement seems overly restrictive for no real gain that I can determine