README.txt in ruby-units-0.3.5 vs README.txt in ruby-units-0.3.6
- old
+ new
@@ -1,8 +1,8 @@
=Ruby Units
-Version: 0.3.5
+Version: 0.3.6
Kevin C. Olbrich, Ph.D.
kevin.olbrich@gmail.com
http://www.sciwerks.com
@@ -78,10 +78,12 @@
unit1 <=> unit2 # => does comparison on quantities in base units,
throws an exception if not compatible
unit1 === unit2 # => true if units and quantity are the same, even if
'equivalent' by <=>
unit.to('ft') # convert
+ unit1 + unit2 >> "ft" # converts result of math to 'ft'
+ (unit1 + unit2).to('ft') # converts result to 'ft'
==Text Output
Units will display themselves nicely based on the preferred abbreviation for the units and prefixes.
Since Unit implements a Unit#to_s, all that is needed in most cases is:
"#{Unit.new('1 mm')}" #=> "1 mm"
@@ -96,12 +98,14 @@
==Time Helpers
Time, Date, and DateTime objects can have time units added or subtracted.
-Time.now + "10 min".u
+Time.now + "10 min".unit
Several helpers have also been defined.
+Note: If you include the 'Chronic' gem, you can specify times in natural
+ language.
'min'.since('9/18/06 3:00pm')
'min'.before('9/18/08 3:00pm')
'days'.until('1/1/07')
'5 min'.from(Time.now)