From: Frew Schmidt Date: 2007-06-16T10:31:59+09:00 Subject: Re: Facets Units. How do I use it? > The exchange rates are not actually the reason for the slow start-up > (the exchanged rates are looked up lazily). Tackling the slow start-up > time is planned for the next version of Units, but at the moment I > still don't have enough time (I may find some in a month or so). > > As for date calculations, currently Units only has a notion of > duration, and it seems only up to days. The current version doesn't > define interaction with actual dates, like adding a month to a today's > date and such. You might want to look at Active Support for the > moment. > > Peter Thanks for the tips! I'll look into it for sure. I think that the stuff I am doing is simple enough that I can do it by hand (you know, minute = 60, hour = 60 * minute, use jurian dates, etc.) I don't know if something in my setup is broken or something, but the vast majority of the examples in the Doc didn't work at all. Here's what happened: >> 1.bit/s + 8.bytes/s NameError: undefined local variable or method `s' for main:Object from (irb):2 >> (1.bit/s).to(byte/s) NameError: undefined local variable or method `s' for main:Object from (irb):3 >> 1.mile.to(feet) NameError: undefined local variable or method `feet' for main:Object from (irb):4 >> 1.acre.to(yd**2) NameError: undefined local variable or method `yd' for main:Object from (irb):5 >> 1.acre.to(sq_yd) NameError: undefined local variable or method `sq_yd' for main:Object from (irb):6 >> 1.gallon.to(self.L) NoMethodError: undefined method `L' for main:Object from (irb):7 >> 1.lb.to(kg) NameError: undefined local variable or method `kg' for main:Object from (irb):8 >> 1.m.s.to(m.s) NameError: undefined local variable or method `m' for main:Object from (irb):9 >> 1.sq_mi.to(km**2) NameError: undefined local variable or method `km' for main:Object from (irb):10 >> 1.mile.to(km) NameError: undefined local variable or method `km' for main:Object from (irb):11 >> 1.usd.to(twd) NameError: undefined local variable or method `twd' for main:Object from (irb):12 If I did like, 1.bit + 1.byte it would work, but the examples above all failed apparently. -- Posted via http://www.ruby-forum.com/.