cargowise 0.8.3 → 0.8.4

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.8.4 - 18th January 2010
2
+ * fix transparent conversion of imperial units to metric
3
+
1
4
  v0.8.3 - 10th January 2011
2
5
  * transparently convert all measurements to metric
3
6
 
@@ -78,8 +78,9 @@ module Cargowise
78
78
 
79
79
  if type.to_s.downcase == "kg"
80
80
  BigDecimal.new(val)
81
- elsif type.to_s.downcase == "lbs"
82
- BigDecimal.new(val) * BigDecimal.new("0.45359237")
81
+ elsif type.to_s.downcase == "lb"
82
+ val = BigDecimal.new(val) * BigDecimal.new("0.45359237")
83
+ val.round(4)
83
84
  else
84
85
  nil
85
86
  end
@@ -94,8 +95,9 @@ module Cargowise
94
95
 
95
96
  if type.to_s.downcase == "m3" # cubic metres
96
97
  BigDecimal.new(val)
97
- elsif type.to_s.downcase == "f3" # cubic feet
98
- BigDecimal.new(val) * BigDecimal.new("0.0283168466")
98
+ elsif type.to_s.downcase == "cf" # cubic feet
99
+ val = BigDecimal.new(val) * BigDecimal.new("0.0283168466")
100
+ val.round(4)
99
101
  else
100
102
  nil
101
103
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cargowise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Healy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-10 00:00:00 +11:00
18
+ date: 2011-01-18 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency