dimensional 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'dimensional/dimension'
2
3
  require 'dimensional/system'
3
4
  require 'dimensional/locale'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'dimensional/dimension'
2
3
  require 'dimensional/system'
3
4
  require 'dimensional/unit'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module Dimensional
2
3
  # Represents a dimension that can be used to characterize a physical quantity. With the exception of certain
3
4
  # fundamental dimensions, all dimensions are expressed as a set of exponents relative to the fundamentals.
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module Dimensional
2
3
  # A Locale is a prioritized list of Systems per Metric.
3
4
  # Locales solve the problem of parsing ambiguous units such as US gallons and Imperial gallons. They also allow
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'dimensional/unit'
2
3
  require 'delegate'
3
4
 
@@ -16,7 +17,7 @@ module Dimensional
16
17
 
17
18
  # The units of this metric, grouped by system.
18
19
  def units
19
- @units ||= Hash.new([]).merge(Unit.select{|u| u.dimension == dimension}.group_by{|u| u.system})
20
+ @units ||= Unit.select{|u| u.dimension == dimension}.inject(Hash.new{|h, s| h[s] = []}){|h, u| h[u.system] << u;h}
20
21
  end
21
22
 
22
23
  def systems(locale)
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'delegate'
2
3
 
3
4
  module Dimensional
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'dimensional/dimension'
2
3
  require 'dimensional/system'
3
4
  require 'set'
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module Dimensional
2
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
3
4
  end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
  require 'dimensional/configurator'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'dimensional/configurator'
2
3
  require 'rational'
3
4
  include Dimensional
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  class DimensionTest < Test::Unit::TestCase
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  class DimensionalTest < Test::Unit::TestCase
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'rubygems'
2
3
  require 'test/unit'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require "helper"
2
3
 
3
4
  class LocaleTest < Test::Unit::TestCase
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
  require 'rational'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  class SystemTest < Test::Unit::TestCase
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  class UnitTest < Test::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimensional
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hapgood
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-10 00:00:00 -05:00
12
+ date: 2010-02-11 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15