active_shipping 0.12.4 → 0.12.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/active_shipping.rb +2 -1
  3. data/lib/active_shipping/shipping/base.rb +2 -2
  4. data/lib/active_shipping/shipping/carrier.rb +16 -13
  5. data/lib/active_shipping/shipping/carriers/benchmark_carrier.rb +3 -4
  6. data/lib/active_shipping/shipping/carriers/bogus_carrier.rb +1 -3
  7. data/lib/active_shipping/shipping/carriers/canada_post.rb +33 -44
  8. data/lib/active_shipping/shipping/carriers/canada_post_pws.rb +72 -81
  9. data/lib/active_shipping/shipping/carriers/fedex.rb +118 -109
  10. data/lib/active_shipping/shipping/carriers/kunaki.rb +33 -32
  11. data/lib/active_shipping/shipping/carriers/new_zealand_post.rb +9 -16
  12. data/lib/active_shipping/shipping/carriers/shipwire.rb +36 -35
  13. data/lib/active_shipping/shipping/carriers/stamps.rb +39 -51
  14. data/lib/active_shipping/shipping/carriers/ups.rb +280 -116
  15. data/lib/active_shipping/shipping/carriers/ups.rb.orig +456 -0
  16. data/lib/active_shipping/shipping/carriers/usps.rb +145 -100
  17. data/lib/active_shipping/shipping/carriers/usps.rb.orig +616 -0
  18. data/lib/active_shipping/shipping/errors.rb +1 -1
  19. data/lib/active_shipping/shipping/label_response.rb +25 -0
  20. data/lib/active_shipping/shipping/location.rb +18 -16
  21. data/lib/active_shipping/shipping/package.rb +51 -54
  22. data/lib/active_shipping/shipping/rate_estimate.rb +10 -12
  23. data/lib/active_shipping/shipping/rate_response.rb +3 -7
  24. data/lib/active_shipping/shipping/response.rb +6 -9
  25. data/lib/active_shipping/shipping/shipment_event.rb +2 -4
  26. data/lib/active_shipping/shipping/shipment_packer.rb +32 -17
  27. data/lib/active_shipping/shipping/shipping_response.rb +2 -4
  28. data/lib/active_shipping/shipping/tracking_response.rb +3 -5
  29. data/lib/active_shipping/version.rb +1 -1
  30. data/lib/vendor/quantified/lib/quantified/attribute.rb +79 -80
  31. data/lib/vendor/quantified/lib/quantified/length.rb +5 -5
  32. data/lib/vendor/quantified/lib/quantified/mass.rb +4 -4
  33. data/lib/vendor/quantified/test/length_test.rb +19 -15
  34. data/lib/vendor/quantified/test/mass_test.rb +14 -14
  35. data/lib/vendor/quantified/test/test_helper.rb +1 -2
  36. data/lib/vendor/test_helper.rb +0 -1
  37. data/lib/vendor/xml_node/benchmark/bench_generation.rb +2 -4
  38. data/lib/vendor/xml_node/lib/xml_node.rb +54 -55
  39. data/lib/vendor/xml_node/test/test_generating.rb +23 -28
  40. data/lib/vendor/xml_node/test/test_parsing.rb +5 -8
  41. metadata +6 -25
  42. checksums.yaml.gz.sig +0 -1
  43. data.tar.gz.sig +0 -0
  44. metadata.gz.sig +0 -0
@@ -5,90 +5,85 @@ require "test/unit"
5
5
  require File.dirname(__FILE__) + "/../lib/xml_node"
6
6
 
7
7
  class TestXmlNode < Test::Unit::TestCase
8
-
9
8
  def test_init_sanity
10
9
  assert_raise(ArgumentError) { XmlNode.new }
11
- assert_nothing_raised { XmlNode.new('feed')}
10
+ assert_nothing_raised { XmlNode.new('feed') }
12
11
  assert_nothing_raised { XmlNode.new('feed', 'content') }
13
12
  assert_nothing_raised { XmlNode.new('feed', :attribute => true) }
14
13
  assert_nothing_raised { XmlNode.new('feed', 'content', :attribute => true) }
15
14
  end
16
-
17
- def test_element_generation
15
+
16
+ def test_element_generation
18
17
  assert_equal '<feed/>', XmlNode.new('feed').to_s
19
18
  assert_equal '<feed>content</feed>', XmlNode.new('feed', 'content').to_s
20
19
  assert_equal "<feed attr='true'>content</feed>", XmlNode.new('feed', 'content', :attr => true).to_s
21
- assert_equal "<feed attr='true'/>", XmlNode.new('feed', :attr => true).to_s
20
+ assert_equal "<feed attr='true'/>", XmlNode.new('feed', :attr => true).to_s
22
21
  end
23
-
22
+
24
23
  def test_nesting
25
24
  assert_equal '<feed><element/></feed>', XmlNode.new('feed') { |n| n << XmlNode.new('element') }.to_s
26
- assert_equal '<feed><element><id>1</id></element></feed>', XmlNode.new('feed') { |n| n << XmlNode.new('element') { |n| n << XmlNode.new('id', '1')} }.to_s
25
+ assert_equal '<feed><element><id>1</id></element></feed>', XmlNode.new('feed') { |n| n << XmlNode.new('element') { |n| n << XmlNode.new('id', '1') } }.to_s
27
26
  end
28
-
27
+
29
28
  def test_cdata
30
29
  node = XmlNode.new('feed')
31
30
  node.text = '...'
32
31
  node.cdata = 'Goodbye world'
33
32
  node.cdata = 'Hello world'
34
-
33
+
35
34
  assert_equal '<feed>...<![CDATA[Hello world]]></feed>', node.to_s
36
35
  assert_equal 'Hello world', node.cdata
37
36
  assert_equal '...', node.text
38
37
  end
39
-
38
+
40
39
  def test_text
41
40
  node = XmlNode.new('feed')
42
41
  node.text = 'Hello world'
43
-
42
+
44
43
  assert_equal '<feed>Hello world</feed>', node.to_s
45
44
  assert_equal 'Hello world', node.text
46
45
  end
47
-
46
+
48
47
  def test_attributes
49
48
  node = XmlNode.new('feed')
50
49
  node['attr'] = 1
51
50
  assert_equal '1', node['attr']
52
51
  end
53
-
52
+
54
53
  def test_namespace
55
54
  node = XmlNode.new('feed')
56
55
  node.namespace 'http://www.w3.org/2005/Atom'
57
56
  assert_equal "<feed xmlns='http://www.w3.org/2005/Atom'/>", node.to_s
58
57
  end
59
-
58
+
60
59
  def test_named_namespace
61
60
  node = XmlNode.new('feed')
62
61
  node.namespace :opensearch, 'http://a9.com/-/spec/opensearch/1.1/'
63
62
  assert_equal "<feed xmlns:opensearch='http://a9.com/-/spec/opensearch/1.1/'/>", node.to_s
64
63
  end
65
-
64
+
66
65
  def test_generate_nice_xml
67
66
  assert_equal "<?xml version='1.0'?>\n<feed>\n <element>test</element>\n <element/>\n</feed>", XmlNode.new('feed') { |n| n << XmlNode.new('element', 'test'); n << XmlNode.new('element') }.to_xml
68
67
  end
69
-
68
+
70
69
  def test_add_array_of_nodes
71
- assert_equal '<feed><e>1</e><e>2</e><e>3</e></feed>', XmlNode.new('feed') { |n| n << [1,2,3].collect{ |i| XmlNode.new('e', i) }}.to_s
70
+ assert_equal '<feed><e>1</e><e>2</e><e>3</e></feed>', XmlNode.new('feed') { |n| n << [1, 2, 3].collect { |i| XmlNode.new('e', i) } }.to_s
72
71
  end
73
-
72
+
74
73
  def test_boolean
75
74
  assert_equal '<boolean>true</boolean>', XmlNode.new('boolean', true).to_s
76
75
  assert_equal '<boolean>false</boolean>', XmlNode.new('boolean', false).to_s
77
76
  end
78
-
77
+
79
78
  def test_nil
80
79
  assert_equal '<nil/>', XmlNode.new('nil', nil).to_s
81
80
  end
82
-
83
-
84
- def test_dont_choke_on_nil_pushing
85
- feed = XmlNode.new 'feed'
86
- assert_nothing_raised do
81
+
82
+ def test_dont_choke_on_nil_pushing
83
+ feed = XmlNode.new 'feed'
84
+ assert_nothing_raised do
87
85
  feed << nil
88
86
  end
89
87
  assert_equal '<feed/>', feed.to_s
90
88
  end
91
-
92
-
93
-
94
- end
89
+ end
@@ -5,25 +5,23 @@ require "test/unit"
5
5
  require File.dirname(__FILE__) + "/../lib/xml_node"
6
6
 
7
7
  class TestXmlNode < Test::Unit::TestCase
8
-
9
- def test_parse_sanity
8
+ def test_parse_sanity
10
9
  assert_raise(ArgumentError) { XmlNode.parse }
11
10
  assert_nothing_raised { XmlNode.parse('<feed/>') }
12
11
  end
13
12
 
14
-
15
13
  def test_parse_attributes
16
14
  node = XmlNode.parse('<feed attr="1"/>')
17
15
  assert_equal '1', node['attr']
18
16
  assert_equal nil, node['attr2']
19
17
  end
20
-
18
+
21
19
  def test_parse_children
22
20
  node = XmlNode.parse('<feed><element>text</element></feed>')
23
21
  assert_equal XmlNode, node.children['element'].class
24
22
  assert_equal 'text', node.children['element'].text
25
23
  end
26
-
24
+
27
25
  def test_enumerate_children
28
26
  count = 0
29
27
  XmlNode.parse('<feed><element>text</element><element>text</element></feed>').children.each { count += 1 }
@@ -37,7 +35,6 @@ class TestXmlNode < Test::Unit::TestCase
37
35
 
38
36
  def test_find_all
39
37
  xml = XmlNode.parse('<feed><elem>1</elem><elem>2</elem><elem>3</elem></feed>')
40
- assert_equal ['1', '2', '3'], xml.find(:all, '//elem').collect(&:text)
38
+ assert_equal %w(1 2 3), xml.find(:all, '//elem').collect(&:text)
41
39
  end
42
-
43
- end
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James MacAulay
@@ -10,30 +10,8 @@ authors:
10
10
  - Jimmy Baker
11
11
  autorequire:
12
12
  bindir: bin
13
- cert_chain:
14
- - |
15
- -----BEGIN CERTIFICATE-----
16
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZhZG1p
17
- bnMxFzAVBgoJkiaJk/IsZAEZFgdzaG9waWZ5MRMwEQYKCZImiZPyLGQBGRYDY29t
18
- MB4XDTE0MDUxNTIwMzM0OFoXDTE1MDUxNTIwMzM0OFowPzEPMA0GA1UEAwwGYWRt
19
- aW5zMRcwFQYKCZImiZPyLGQBGRYHc2hvcGlmeTETMBEGCgmSJomT8ixkARkWA2Nv
20
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0/81O3e1vh5smcwp2G
21
- MpLQ6q0kejQLa65bPYPxdzWA1SYOKyGfw+yR9LdFzsuKpwWzKq6zX35lj1IckWS4
22
- bNBEQzxmufUxU0XPM02haFB8fOfDJzdXsWte9Ge4IFwahwn68gpMqN+BvxL+KMYz
23
- Iut9YmN44d4LZdsENEIO5vmybuG2vYDz7R56qB0PA+Q2P2CdhymsBad2DQs69FBo
24
- uico9V6VMYYctL9lCYdzu9IXrOYNTt88suKIVzzAlHOKeN0Ng5qdztFoTR8sfxDr
25
- Ydg3KHl5n47wlpgd8R0f/4b5gGxW+v9pyJCgQnLlRu7DedVSvv7+GMtj3g9r3nhJ
26
- KqECAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/o
27
- maf34HXbUOQsdoLHacEKQgunMB0GA1UdEQQWMBSBEmFkbWluc0BzaG9waWZ5LmNv
28
- bTAdBgNVHRIEFjAUgRJhZG1pbnNAc2hvcGlmeS5jb20wDQYJKoZIhvcNAQEFBQAD
29
- ggEBADkK9aj5T0HPExsov4EoMWFnO+G7RQ28C30VAfKxnL2UxG6i4XMHVs6Xi94h
30
- qXFw1ec9Y2eDUqaolT3bviOk9BB197+A8Vz/k7MC6ci2NE+yDDB7HAC8zU6LAx8Y
31
- Iqvw7B/PSZ/pz4bUVFlTATif4mi1vO3lidRkdHRtM7UePSn2rUpOi0gtXBP3bLu5
32
- YjHJN7wx5cugMEyroKITG5gL0Nxtu21qtOlHX4Hc4KdE2JqzCPOsS4zsZGhgwhPs
33
- fl3hbtVFTqbOlwL9vy1fudXcolIE/ZTcxQ+er07ZFZdKCXayR9PPs64heamfn0fp
34
- TConQSX2BnZdhIEYW+cKzEC/bLc=
35
- -----END CERTIFICATE-----
36
- date: 2014-07-07 00:00:00.000000000 Z
13
+ cert_chain: []
14
+ date: 2014-12-16 00:00:00.000000000 Z
37
15
  dependencies:
38
16
  - !ruby/object:Gem::Dependency
39
17
  name: activesupport
@@ -199,8 +177,11 @@ files:
199
177
  - lib/active_shipping/shipping/carriers/shipwire.rb
200
178
  - lib/active_shipping/shipping/carriers/stamps.rb
201
179
  - lib/active_shipping/shipping/carriers/ups.rb
180
+ - lib/active_shipping/shipping/carriers/ups.rb.orig
202
181
  - lib/active_shipping/shipping/carriers/usps.rb
182
+ - lib/active_shipping/shipping/carriers/usps.rb.orig
203
183
  - lib/active_shipping/shipping/errors.rb
184
+ - lib/active_shipping/shipping/label_response.rb
204
185
  - lib/active_shipping/shipping/location.rb
205
186
  - lib/active_shipping/shipping/package.rb
206
187
  - lib/active_shipping/shipping/rate_estimate.rb
@@ -1 +0,0 @@
1
- #������q\Xpb�Fk��*��.B�O�|8���]u/�2�7��lq6���!� ��&���a?D-��iX�[�#pX�Rj4b����
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file