olbrich/ruby-units — Issue #35: Unit alias 'pt' ambiguous
Author: jsteinberg
Created: 2012-02-01 17:42:55+00:00
State: open

In the unit_definitions / standard.rb file 'pt' is used as an alias twice.

Unit.define('pint') do |pint|
pint.definition = Unit('1/8 gal')
pint.aliases = %w{pt pint pints}
end

Unit.define('point') do |point|
point.definition = Unit('1/72 ft')
point.aliases = %w{pt point points}
end

I believe the pint is created first and the point unit overrides it's 'pt' alias in the base_unit_cache. In my project I was using pints as pt, and now that is broken. I have fixed it with an initializer in my project, but I feel like one of these should be removed.

I could submit a trivial pull request fixing it one way or another, but as the gem author it is probably your call on which one to keep.