I think the alias idea is a good one. I have submitted a patch that
does exactly that.
http://dev.rubyonrails.org/ticket/5387
Jamie,
Your patch has one fundamental flaw. Purists who would want to use kibibyte etc. to display sizes measured in base 2 units would sure be against kilobyte etc. measuring in base 2 units too. In other words, this is only half of the solution, and we are looking for a complete one.
James: about drop-kicking the principle of least surprise - in my opinion, programmers who would be surprised to find out 'kilo' means 1000 are the same who don't exactly care about the precision. So I don't think they are even going to notice.
About the potential breakage: in my patch, there is a method (ActiveSupport::CoreExtensions::Numeric::Bytes.legacy_base) which makes good ol' methods measure in base 2 units again. Folk who don't want to roll with this change would put that in environment.rb, preventing breakage.
About writing a plugin for this: sure I'm going to make a plugin out of my patch; I just need to set up a repository for this. But I never believed this was just some odd, wacky practice intented for rare people -- I believe this should be Rails core to raise awareness in current and (especially) next generations. Today, precision matters; Strongspace, some bittorent clients and trackers, and others all demonstrate this.
_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core