quantity icon indicating copy to clipboard operation
quantity copied to clipboard

Quantity descriptions for ruby

Results 7 quantity issues
Sort by recently updated
recently updated
newest added

Hi, We noticed some performance issues when working with large numbers of integers. We tracked the issue down to the `#method_missing` implementation defined on the `Numeric` class in this gem....

Hi, I spent a few hours fixing some of the stuff that seemed obviously wrong. Some of it was Ruby 1.9.3 compatibility, some of it was broken/inconsistent specs, and some...

``` class Screen < Quantity::Dimension::Length; end; Screen.add_dimension :screen Quantity::Unit.add_unit :px, :screen, 233333, :pixel, :pixels puts 3.cm.to_px ``` Returns: ``` /var/lib/gems/1.9.1/gems/quantity-0.1.2/lib/quantity/unit.rb:236:in `convert': Cannot convert # to cm (ArgumentError) from /var/lib/gems/1.9.1/gems/quantity-0.1.2/lib/quantity.rb:331:in `convert'...

> 1.m / 1.m > NoMethodError: undefined method `dimension' for nil:NilClass > from .../quantity-0.1.2/lib/quantity/dimension.rb:113:in`initialize' > from ../quantity-0.1.2/lib/quantity/dimension.rb:147:in `new' > from ../quantity-0.1.2/lib/quantity/dimension.rb:147:in`/' > from ../quantity-0.1.2/lib/quantity/unit.rb:211:in `/' > from ../quantity-0.1.2/lib/quantity.rb:206:in`/' > ......

``` 1.9.3p0 :001 > require 'quantity' => true 1.9.3p0 :002 > Quantity::VERSION => 0.1.2 1.9.3p0 :003 > [1.gallon, 1.gallon].flatten ArgumentError: Unknown target unit type: ary from /home/brundage/.rvm/gems/ruby-1.9.3-p0/gems/quantity-0.1.2/lib/quantity.rb:356:in `method_missing' from (irb):3:in...

``` 0 HAL:0 work % irb 1.9.3p0 :001 > require 'quantity' => true 1.9.3p0 :002 > q = Quantity.new(1, 'ml') NoMethodError: undefined method `value' for nil:NilClass from /home/brundage/.rvm/gems/ruby-1.9.3-p0/gems/quantity-0.1.2/lib/quantity/unit.rb:297:in `block (2...