active_shipping 0.9.12 → 0.9.13

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.
@@ -113,13 +113,10 @@ module ActiveMerchant
113
113
  }
114
114
 
115
115
  def self.size_code_for(package)
116
- total = package.inches(:length) + package.inches(:girth)
117
- if total <= 84
118
- return 'REGULAR'
119
- elsif total <= 108
120
- return 'LARGE'
121
- else # <= 130
122
- return 'OVERSIZE'
116
+ if package.inches(:max) <= 12
117
+ 'REGULAR'
118
+ else
119
+ 'LARGE'
123
120
  end
124
121
  end
125
122
 
@@ -214,10 +211,10 @@ module ActiveMerchant
214
211
  package << XmlNode.new('Ounces', "%0.1f" % [p.ounces,1].max)
215
212
  package << XmlNode.new('Container', CONTAINERS[p.options[:container]])
216
213
  package << XmlNode.new('Size', USPS.size_code_for(p))
217
- package << XmlNode.new('Width', p.inches(:width))
218
- package << XmlNode.new('Length', p.inches(:length))
219
- package << XmlNode.new('Height', p.inches(:height))
220
- package << XmlNode.new('Girth', p.inches(:girth))
214
+ package << XmlNode.new('Width', "%0.2f" % p.inches(:width))
215
+ package << XmlNode.new('Length', "%0.2f" % p.inches(:length))
216
+ package << XmlNode.new('Height', "%0.2f" % p.inches(:height))
217
+ package << XmlNode.new('Girth', "%0.2f" % p.inches(:girth))
221
218
  is_machinable = if p.options.has_key?(:machinable)
222
219
  p.options[:machinable] ? true : false
223
220
  else
@@ -263,10 +260,10 @@ module ActiveMerchant
263
260
  end
264
261
  package << XmlNode.new('Container', p.cylinder? ? 'NONRECTANGULAR' : 'RECTANGULAR')
265
262
  package << XmlNode.new('Size', USPS.size_code_for(p))
266
- package << XmlNode.new('Width', [p.inches(:width), 0.01].max)
267
- package << XmlNode.new('Length', [p.inches(:length), 0.01].max)
268
- package << XmlNode.new('Height', [p.inches(:height), 0.01].max)
269
- package << XmlNode.new('Girth', [p.inches(:girth), 0.01].max)
263
+ package << XmlNode.new('Width', "%0.2f" % [p.inches(:width), 0.01].max)
264
+ package << XmlNode.new('Length', "%0.2f" % [p.inches(:length), 0.01].max)
265
+ package << XmlNode.new('Height', "%0.2f" % [p.inches(:height), 0.01].max)
266
+ package << XmlNode.new('Girth', "%0.2f" % [p.inches(:girth), 0.01].max)
270
267
  end
271
268
  end
272
269
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "0.9.12"
2
+ VERSION = "0.9.13"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- hash: 35
4
+ hash: 33
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 12
10
- version: 0.9.12
9
+ - 13
10
+ version: 0.9.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - James MacAulay
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-04-21 00:00:00 -04:00
21
+ date: 2011-04-27 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency