Closed jph closed 10 years ago
@jph, both methods are not in the current release of alchemist, but will be in the next. If you pulled alchemist down from github and did the following it would work.
> $LOAD_PATH.unshift "./lib"
> require "alchemist"
=> true
> Alchemist.setup
=> [:absorbed_radiation_dose, :angles, :area, :capacitance, :distance, :dose_equivalent, :electric_charge, :electric_conductance, :electrical_impedance, :electromotive_force, :energy, :frequency, :force, :illuminance, :inductance, :information_storage, :luminous_flux, :luminous_intensity, :magnetic_flux, :magnetic_inductance, :mass, :power, :pressure, :radioactivity, :time, :volume, :density, :temperature]
> Alchemist.register(:time, [:atomus], (1/376r).minutes.to.seconds.value)
=> [:atomus]
> 1.atomus.to.minutes.value
=> 0.0026595744680851068
> Alchemist.reset!
=> nil
> 1.atomus.to.minutes.value
NoMethodError: undefined method `first' for false:FalseClass
> 1.second
=> #<Alchemist::Measurement:0x007f93b9f1ec40 @value=1.0, @unit_name=:second, @exponent=1.0>
I'm going to try and release a new version some time between this and next week.
FYI, reset! doesn't actually seem to be doing what I want it to.
Thanks, I didn't think to check that. Will wait on the next release, cheers.
Tested with Ruby 2.0.0p451 and Ruby 2.1.1p76
Alchemist.reset! also does not work, although other class methods do (.setup, .measure).