5.19.0 - 2025-01-12
- Added US Customary units for square foot (
sq_ft
), square mile (sq_mi
), and square chain (sq_ch
).
- Changed symbol of units
cb (M)
andcb (US)
tometric_cb
andus_cb
inlength
. - Changed symbol of unit
hp (M)
tometric_hp
inpower
. - Changed symbol of unit
cwt (US)
tous_cwt
inweight
.
5.18.0 - 2023-12-16
- Added unit group for
mass flow rate
units. - Added unit group for
volumetric flow rate
units.
5.17.0 - 2023-12-15
- Added new units
qr
,U
, andz
inlength
. - Added new units
qr
,fir
, andus_qr
inweight
. - Added new units
dun
,sec
, andtwp
inarea
. - Added new units
st
,fir
, andpot
involume
.
- Changed implementation of
#units_for!
to raise error if the unit system is not defined within the unit group. - Changed symbol of
barleycorn
length unit.
5.16.0 - 2023-12-13
- Added planck units and their conversions.
5.15.0 - 2023-12-11
- Added
.define_conversion_methods
method to define conversion helper methods for units.
5.14.0 - 2023-11-29
- Added
.define_numeric_methods
method to define numeric extension methods for units.
5.13.0 - 2023-11-27
- Added
Measurement#to_primitive
to convert the measurement to the primitive unit. - Added
#cbrt
method to calculate cube root of the measurement quantity. - Added
#sqrt
method to calculate square root of the measurement quantity. - Aliased
#to_primitive
method as#in_primitive
and#as_primitive
.
5.12.0 - 2023-11-25
- Added
MissingPrimitiveUnitError
error if user tries to convert measurement to the primitive unit but it's not set for the unit group. - Aliased
#+
method as#add
. - Aliased
#-
method as#subtract
. - Aliased
#*
method as#times
and#multiply
. - Aliased
#/
method as#divide
.
5.11.1 - 2023-11-16
- Moved
BaseError
to base file for removing uninitialized constant error in reverse dependencies viz. unit_measurements-rails and composite_unit_measurements.
5.11.0 - 2023-11-11
- Added
#systems
method to return unit systems within the unit group. - Added
#ratio
method to calculate the ratio between two units.
5.10.0 - 2023-11-09
- Added new method
#to_fs
to format the measurement. - Aliased arithmetic method
#**
to#pow
and#^
. - Aliased arithmetic method
#-@
to#inverse
and#negate
. - Added
UnitMeasurements::BlankQuantityError
error if tried to initialize theMeasurement
with a blank quantity. - Added
UnitMeasurements::BlankUnitError
error if tried to initialize theMeasurement
with a blank unit.
#format
method in favour of#to_fs
.
5.9.0 - 2023-11-08
- Added new units of
force
. - Added new units of
torque
. - Added new units of
energy
.
5.8.0 - 2023-11-06
- Added new units of
pressure
. - Added new units of
power
.
5.7.0 - 2023-11-04
- Added new units
λ
,cd
, andcd-ft
involume
. - Added new units
tn
,LT
,hyl
,cwt
, andcwt (US)
inweight
. - Added new units
μ
,cb
,b.c.
,S
,ls
,lmin
,lh
,ld
,lw
,lm
,ly
inlength
. - Added new units
tr
,cyc
,sign
,octant
,sextant
, andquadrant
inplane angle
.
- Removed wrong plural aliases from units of
frequency
andmagnetic induction
.
5.6.1 - 2023-11-03
- Removed uneeded aliases from units.
- Removed test cases of all unit conversions other than primitive unit.
5.6.0 - 2023-10-31
- Added new units
ftm³
,pk
,gt
,bsh
,min
,bkt
,hhd
,fls
,dspn
,fldr
,bdft
,ac⋅ft
,ac⋅in
in volume. - Added new units
oz/ft³
,oz/in³
,oz/gal
,lb/ft³
,lb/in³
,lb/gal
,slug/ft³
,slug/in³
in density.
5.5.0 - 2023-10-29
- Added new units
ipm/s
,iph/s
,mi/s²
,mpm/s
,mph/s
,fpm/s
,fph/s
,Gal
in acceleration. - Added new units
mi/s
,mi/min
,mi/h
, andfur/ftn
in velocity. - Added new units
lnk²
,ac
,ft²
,mi²
,ch²
,bd
, andro
in area.
- Changed unit name
rod²
tord²
along with its aliases.
5.4.1 - 2023-10-28
- Updated unit systems and aliases of unit groups.
- Added alternative names for unit groups in unit reference file.
5.4.0 - 2023-10-27
- Added new units
Å
,lnk
,lea
,hh
,nl
, andsft
in length. - Added new units
N
,s
,drt
, andlbt
in weight.
5.3.0 - 2023-10-24
- Added ability set globally configurable options for
unit_measurements
.
- Code coverage improvements.
5.2.0 - 2023-10-22
- Added ability to set name of the cache file for the unit group.
- Added support for caching conversion factors between units of the unit group.
5.1.1 - 2023-10-20
- Updated readme and documentation.
- Updated documentation hosting link to
https://shivam091.github.io/unit_measurements
.
5.1.0 - 2023-10-19
- Added new methods (
**
,-@
,nonzero?
,zero?
,positive?
,negative?
,finite?
, andinfinite?
) to perform arithmetic operations. - Added new alias
scale
for**
arithmetic method.
- Updated readme and documentation.
- Updated documentation hosting link to
https://rubydoc.info/gems/unit_measurements
.
5.0.0 - 2023-10-18
- Added support to add binary SI prefixes for the unit.
- Added support to convert the measurement to a
primitive
unit of the unit group. - Added methods
UnitGroup#units_for
andUnitGroup#units_for!
to find units within the specified unit system.
4.12.0 - 2023-10-16
- Added new units in
area
(are, barn, hectare, acre, square chain, square furlong, square rod) unit group. - Added new units in
volume
(cup, quart, gill, pint, gallon, barrel, teaspoon, tablespoon, fluid ounce) unit group.
4.11.0 - 2023-10-15
- Added new units in
length
(ch, th, ftm, fur, nmi, rod, au, pc) unit group. - Added new units in
weight
(ct, Da, lb, st, oz, gr, ozt, dwt, dr, slug) unit group.
4.10.0 - 2023-10-14
- Added documentation for all modules, classes, and methods.
- Updated readme and added workflow for publishing documentation using
yardoc
.
4.9.0 - 2023-10-13
- Added unit group for
information entropy
units.
4.8.0 - 2023-10-12
- Added unit group for
radiation exposure
units. - Added unit group for
radiation absorbed dose
units. - Added unit group for
radiation equivalent dose
units.
4.7.0 - 2023-10-11
- Added unit group for
magnetomotive force
units. - Added unit group for
radioactivity
units.
4.6.0 - 2023-10-10
- Added unit group for
dynamic viscosity
units. - Added unit group for
kinetic viscosity
units.
4.5.0 - 2023-10-09
- Added unit group for
energy
units. - Added unit group for
power
units.
4.4.0 - 2023-10-08
- Added unit group for
luminance
units. - Added unit group for
frequency
units.
4.3.0 - 2023-10-07
- Added unit group for
luminous flux
units. - Added unit group for
illuminance
units.
4.2.0 - 2023-10-06
- Added unit group for
pressure
units. - Added unit group for
torque
units.
4.1.0 - 2023-10-05
- Added unit group for
catalytic activity
units. - Added unit group for
electric dipole moment
units. - Added unit group for
electric quadrupole moment
units.
4.0.0 - 2023-10-04
- Added support to set
primitive
unit for each unit group. - Added support to set
system
inUnit
metadata. - Added
UnitMeasurements::PrimitiveUnitAlreadySetError
error ifprimitive
unit is defined more than one time in the unit group.
- Renamed
Voltage
unit group class toElectricPotential
. - Renamed
Conductance
unit group class toElectricConductance
. - Renamed
Resistance
unit group class toElectricalResistance
. - Renamed
Elastance
unit group class toElectricalElastance
. - Renamed
Capacitance
unit group class toElectricalCapacitance
. - Renamed
Inductance
unit group class toElectricalInductance
.
- Removed support to build
UnitSystem
instances for each system within the unit group. - Removed support to set
primitive
unit for each unit system within the unit group.
3.8.0 - 2023-10-03
- Added unit group for
magnetic field
units. - Added unit group for
inductance
units.
3.7.0 - 2023-10-02
- Added unit group for
magnetic flux
units. - Added unit group for
magnetic induction
units
3.6.0 - 2023-10-01
- Added unit group for
resistance
units. - Added unit group for
conductance
units.
3.5.0 - 2023-09-30
- Added unit group for
capacitance
units. - Added unit group for
elastance
units.
3.4.1 - 2023-09-29
- Updated usage examples in readme.
- Removed overridden
Measurement.name
method.
3.4.0 - 2023-09-28
- Added ability to group units by
unit system
. - Added ability to set
primitive
unit for each unit system. - Added method
primitive?
to check whether the unit is primitive or not. - Added method
system_for
to find unit system by name.
- Grouped units in system and set primitive unit for those systems.
3.3.0 - 2023-09-28
- Added unit group for
electric charge
units. - Added unit group for
angular velocity
units.
3.2.0 - 2023-09-27
- Added unit group for
acceleration
units. - Added unit group for
angular acceleration
units.
3.1.0 - 2023-09-26
- Added unit group for
voltage
units. - Added unit group for
velocity
units.
3.0.0 - 2023-09-25
- Added method
Measurement.name
to get humanized name of the unit group. - Raised
BaseError
inMeasurement.unit_group
. - Added aliases
in
,as
,in!
,as
forconvert_to
andconvert_to!
methods.
- Moved LICENSE to markdown file.
- Replaced
$LOAD_PATH
by shorthand$:
- Replaced
base
method byunit
.
2.6.2 - 2023-09-25
- Replaced
String
bySymbol
in unit names and symbols.
2.6.1 - 2023-09-24
- Replaced
Symbol
byString
in unit names and symbols.
2.6.0 - 2023-09-24
- Added unit group for
force
units. - Added unit group for
solid angle
units.
2.5.0 - 2023-09-23
- Added unit group for
sound level
units. - Added unit group for
plane angle
units.
2.4.0 - 2023-09-23
- Added unit group for
density
units. - Added unit group for
quantity
units.
2.3.0 - 2023-09-22
- Added unit group for
area
units. - Added unit group for
volume
units.
2.2.0 - 2023-09-21
- Added unit group for
electric current
units. - Added unit group for
luminous intensity
units. - Added unit group for
temperature
units.
2.1.0 - 2023-09-20
- Added unit group for
time
units. - Added unit group for
amount of substance
units.
1.7.0 - 2023-09-20
- Added support to convert the measurements to other numeric types viz.,
Integer
,BigDecimal
,Rational
,Complex
, andFloat
.
1.6.0 - 2023-09-19
- Added support to perform mathematical operations on the measurements.
1.5.1 - 2023-09-18
- Added extra blank line between method code and last code statement (considered as return).
1.5.0 - 2023-09-18
- Fixed precision in
Measurement#quantity
method.
1.4.0 - 2023-09-17
- Added ability to perform
arithmetic
operations of measurements.
1.3.0 - 2023-09-16
- Added ability to compare two measurements of the same unit group.
1.2.0 - 2023-09-15
- Added support to specify unit value as an
array
of number and unit.
1.1.0 - 2023-09-14
- Added
#format
method to format quantity of the measurement.
1.0.0 - 2023-09-14
- Added support to build unit groups.
- Added unit group for
length
units. - Added unit group for
weight
units. - Added support to build
si
units. - Added support to parse
Complex
,Rational
,Scientific
numbers, andratios
. - Added support to convert quantity between two units using
#convert_to
,#convert_to!
, and#parse
methods. - Added normalizer to normalize special characters used in numbers.