olbrich/ruby-units — pull request #36 by avitevet (2012-02-26 08:31:21+00:00)
Title: allowing strings without space between scalar & unit

Hi,

I've recently discovered your ruby-units gem and would like to use it in my project (fitlogr.com). The functionality will be perfect for allowing user input in many types of distance or weight.

I will need it to allow numbers & units without space in between them, like "5k" or "95lbs." With the code currently in the github repo, when I run "1.1m".to_unit in irb, I get a systemstackerror, "stack level too deep." So I made a change that stops this from happening. I also cleaned up the test/ directory & added a test to the test_ruby-units.rb file, only because I'm familiar with that environment and not with the rspec environment.

I would like this change merged back into your repo because I think that this is the only change I'll make to the gem, and I would like to continue to get your updates without first merging them into my fork.

Thanks,

Avi