Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

This branch is even with calamitas:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.config/syckle first commit
lib/van admin: update metadata per latest pom
qed
site admin: more links on website
test first commit
work admin: prepare for new POM standard
.gemspec Updates for using .ruby and Detroit build tool. [admin]
.gitignore admin: rearrange rdocs
.ruby Updates for using .ruby and Detroit build tool. [admin]
Assembly Updates for using .ruby and Detroit build tool. [admin]
History.rdoc admin: change case of meta files
HowItWorks.rdoc admin: change case of meta files
License.txt admin: change case of meta files
Manifest Updates for using .ruby and Detroit build tool. [admin]
Profile Updates for using .ruby and Detroit build tool. [admin]
README.rdoc first commit

README.rdoc

VanUnits

Description

VanUnits is a sophisticated SI units system. It also includes currency units and a large set of scientific constants.

Usage

Here are some examples of using the units system.

reqiure 'van/units'

include Van::Units

1.bit/s + 8.bytes/s
(1.bit/s).to(byte/s)
1.mile.to(feet)
1.acre.to(yd**2)
1.acre.to(sq_yd)
1.gallon.to(self.L)
1.lb.to(kg)
1.m.s.to(m.s)
1.sq_mi.to(km**2)
1.mile.to(km)

Van::Units is namespace for all unit related classes. Mixing this in has the additional effect of making Units.with_unit_converter available without the Units. prefix, as well as the shortcuts for creating Units (see Van::Units#method_missing).

Constants

Also included are a large assortment of real world contants. These come in two varieties, typeless and typed via units.rb. (PLEASE NOTE: The typed variety is not yet complete).

Constants are also provided in both mks (m kg s) and in cgs (cm g s) format.

require 'van/units/constants/mks'
require 'van/units/constants/cgs'

include Van::Units::Constants

MKS::SPEED_OF_LIGHT              #=> 2.99792458e8 m/s
CGS::SPEED_OF_LIGHT              #=> 2.99792458e10 cm/s

Big thanks to Daniel Carrera and Brian Gough for their original work on Math::Constants from which these numbers derive.

Authors/Contributors

  • Peter Vanbroekhoven

  • Thomas Sawyer

  • Daniel Carrera

  • Brian Gough

License

Copyright 2006, 2007 Peter Vanbroekhoven, Thomas Sawyer

Stick is distributed under the terms of the MIT license.

Something went wrong with that request. Please try again.