README.md in ruby-units-1.4.3 vs README.md in ruby-units-1.4.4
- old
+ new
@@ -1,13 +1,11 @@
# Ruby Units
[](http://travis-ci.org/olbrich/ruby-units)
-Kevin C. Olbrich, Ph.D.
+Kevin C. Olbrich, Ph.D.
-[Sciwerks.com](http://www.sciwerks.com)
-
Project page: [http://github.com/olbrich/ruby-units](http://github.com/olbrich/ruby-units)
## Introduction
Many technical applications make use of specialized calculations at some point. Frequently, these calculations require unit conversions to ensure accurate results. Needless to say, this is a pain to properly keep track of, and is prone to numerous errors.
@@ -32,13 +30,13 @@
unit = Unit('1+1i mm') # Complex Number
## Rules:
1. only 1 quantity per unit (with 2 exceptions... 6'5" and '8 lbs 8 oz')
2. use SI notation when possible
-3. avoid using spaces in unit names
+3. spaces in units are allowed, but ones like '11/m' will be recognized as '11 1/m'.
-## Unit compatability:
+## Unit compatibility:
Many methods require that the units of two operands are compatible. Compatible units are those that can be easily converted into each other, such as 'meters' and 'feet'.
unit1 =~ unit2 #=> true if units are compatible
unit1.compatible?(unit2) #=> true if units are compatible
@@ -168,6 +166,21 @@
This is useful for changing display names, adding aliases, etc.
Unit.redefine!("cup") do |cup|
cup.display_name = "cup"
end
-
+
+
+### Namespaced Class
+
+Sometimes the default class 'Unit' may conflict with other gems or applications. Internally ruby-units defines itself using the RubyUnits namespace.
+The actual class of a unit is the RubyUnits::Unit. For simplicity and backwards compatiblity, the '::Unit' class is defined as an alias to '::RubyUnits::Unit'.
+
+To load ruby-units without this alias...
+
+ require 'ruby-units/namespaced'
+
+When using bundler...
+
+ gem 'ruby-units', require: 'namespaced'
+
+Note: when using the namespaced version, the Unit('unit string') helper will not be defined.