Permalink
Browse files

minor gem spec updates and doc fixes

  • Loading branch information...
1 parent 2d0dd85 commit e0e3dd6a343045d1e5c536666b8c054502c15ace @bhuga committed Jan 5, 2010
Showing with 10 additions and 7 deletions.
  1. +4 −1 .gemspec
  2. +3 −3 lib/quantity/dimension.rb
  3. +3 −3 lib/quantity/unit.rb
View
@@ -9,7 +9,10 @@ GEMSPEC = Gem::Specification.new do |gem|
gem.homepage = 'http://quantity.rubyforge.org/'
gem.license = 'Public Domain' if gem.respond_to?(:license=)
gem.summary = 'Units and quantities for Ruby.'
- gem.description = gem.summary
+ gem.description = <<-EOF
+ Quantity provides first-class quantities, units, and base quantities in pure ruby.
+ Things like 1.meter / 1.second == 1 meter/second.
+ EOF
gem.rubyforge_project = 'quantity'
gem.authors = ['Ben Lavender', 'Arto Bendiken']
@@ -122,7 +122,7 @@ def to_s
# Dimensional multiplication
# @param [Dimension] other
- # @result [Dimension::Compound]
+ # @return [Dimension]
def *(other)
raise ArgumentError, "Cannot multiply #{self} and #{other.class}" unless other.is_a?(Dimension)
(new_n, new_d) = Dimension.reduce(@numerators + other.numerators, @denominators + other.denominators)
@@ -132,7 +132,7 @@ def *(other)
# Dimensional division
# @param [Dimension] other
- # @result [Dimension::Compound]
+ # @return [Dimension]
def /(other)
raise ArgumentError, "Cannot divide #{self} by #{other.class}" unless other.is_a?(Dimension)
(new_n, new_d) = Dimension.reduce(@numerators + other.denominators, @denominators + other.numerators)
@@ -142,7 +142,7 @@ def /(other)
# Dimensional exponentiation
# @param [Numeric] other
- # @result [Compound]
+ # @return [Dimension]
def **(other)
raise ArgumentError, "Dimensions can only be raised to whole powers" unless other.is_a?(Fixnum) && other > 0
other == 1 ? self : self * self**(other-1)
View
@@ -159,7 +159,7 @@ def <=>(other)
# Exponentiation
# @param other [Numeric]
- # @return [Unit::Compound]
+ # @return [Unit]
def **(other)
if other.is_a?(Fixnum) && other > 0
other == 1 ? self : self * self**(other-1)
@@ -253,8 +253,8 @@ def self.from_string_form(to)
# @overload initialize(opts = {})
# @param opts [String Symbol] :name
# @param opts [[Unit]] :units
- # @param opts [Dimension::Compound] :dimension
- # @return [Unit::Compound]
+ # @param opts [Dimension] :dimension
+ # @return [Unit]
def initialize(opts)
@units = opts[:units]
@dimension = opts[:dimension]

0 comments on commit e0e3dd6

Please sign in to comment.