fedex 3.6.0 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/fedex.gemspec +9 -11
- data/lib/fedex/version.rb +1 -1
- data/spec/lib/fedex/document_spec.rb +4 -4
- data/spec/lib/fedex/rate_spec.rb +17 -17
- data/spec/lib/fedex/shipment_spec.rb +5 -5
- metadata +16 -17
data/fedex.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require
|
3
|
+
require 'fedex/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = 'fedex'
|
7
7
|
s.version = Fedex::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = [
|
10
|
-
s.email = [
|
11
|
-
s.homepage =
|
9
|
+
s.authors = ['Jazmin Schroeder']
|
10
|
+
s.email = ['jazminschroeder@gmail.com']
|
11
|
+
s.homepage = 'https://github.com/jazminschroeder/fedex'
|
12
12
|
s.summary = %q{Fedex Web Services}
|
13
|
-
s.description = %q{Provides an interface to Fedex Web Services
|
13
|
+
s.description = %q{Provides an interface to Fedex Web Services}
|
14
14
|
|
15
|
-
s.rubyforge_project =
|
15
|
+
s.rubyforge_project = 'fedex'
|
16
16
|
|
17
17
|
s.license = 'MIT'
|
18
18
|
|
19
|
-
s.add_dependency 'httparty', '~> 0.
|
19
|
+
s.add_dependency 'httparty', '~> 0.13.0'
|
20
20
|
s.add_dependency 'nokogiri', '~> 1.6.0'
|
21
21
|
|
22
22
|
s.add_development_dependency "rspec", '~> 2.9.0'
|
@@ -28,7 +28,5 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.files = `git ls-files`.split("\n")
|
29
29
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
30
30
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
31
|
-
s.require_paths = [
|
32
|
-
|
33
|
-
|
31
|
+
s.require_paths = ['lib']
|
34
32
|
end
|
data/lib/fedex/version.rb
CHANGED
@@ -5,16 +5,16 @@ module Fedex
|
|
5
5
|
describe Document do
|
6
6
|
let(:fedex) { Shipment.new(fedex_credentials) }
|
7
7
|
let(:shipper) do
|
8
|
-
{:name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "King Street", :city => "Ashbourne", :postal_code => "DE6 1EA", :country_code => "GB"}
|
8
|
+
{ :name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "King Street", :city => "Ashbourne", :postal_code => "DE6 1EA", :country_code => "GB" }
|
9
9
|
end
|
10
10
|
let(:recipient) do
|
11
|
-
{:name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
11
|
+
{ :name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
12
12
|
end
|
13
13
|
let(:packages) do
|
14
14
|
[
|
15
15
|
{
|
16
|
-
:weight => {:units => "LB", :value => 2},
|
17
|
-
:dimensions => {:length => 10, :width => 5, :height => 4, :units => "IN" }
|
16
|
+
:weight => { :units => "LB", :value => 2 },
|
17
|
+
:dimensions => { :length => 10, :width => 5, :height => 4, :units => "IN" }
|
18
18
|
}
|
19
19
|
]
|
20
20
|
end
|
data/spec/lib/fedex/rate_spec.rb
CHANGED
@@ -18,20 +18,20 @@ module Fedex
|
|
18
18
|
describe "rate service" do
|
19
19
|
let(:fedex) { Shipment.new(fedex_credentials) }
|
20
20
|
let(:shipper) do
|
21
|
-
{:name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Harrison", :state => "AR", :postal_code => "72601", :country_code => "US"}
|
21
|
+
{ :name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Harrison", :state => "AR", :postal_code => "72601", :country_code => "US" }
|
22
22
|
end
|
23
23
|
let(:recipient) do
|
24
|
-
{:name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
24
|
+
{ :name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
25
25
|
end
|
26
26
|
let(:packages) do
|
27
27
|
[
|
28
28
|
{
|
29
|
-
:weight => {:units => "LB", :value => 2},
|
30
|
-
:dimensions => {:length => 10, :width => 5, :height => 4, :units => "IN" }
|
29
|
+
:weight => { :units => "LB", :value => 2 },
|
30
|
+
:dimensions => { :length => 10, :width => 5, :height => 4, :units => "IN" }
|
31
31
|
},
|
32
32
|
{
|
33
|
-
:weight => {:units => "LB", :value => 6},
|
34
|
-
:dimensions => {:length => 5, :width => 5, :height => 4, :units => "IN" }
|
33
|
+
:weight => { :units => "LB", :value => 6 },
|
34
|
+
:dimensions => { :length => 5, :width => 5, :height => 4, :units => "IN" }
|
35
35
|
}
|
36
36
|
]
|
37
37
|
end
|
@@ -41,22 +41,22 @@ module Fedex
|
|
41
41
|
|
42
42
|
context "domestic shipment", :vcr do
|
43
43
|
it "should return a rate" do
|
44
|
-
rates = fedex.rate({:shipper => shipper, :recipient => recipient, :packages => packages, :service_type => "FEDEX_GROUND"})
|
44
|
+
rates = fedex.rate({ :shipper => shipper, :recipient => recipient, :packages => packages, :service_type => "FEDEX_GROUND"})
|
45
45
|
rates.first.should be_an_instance_of(Rate)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
context "canadian shipment", :vcr do
|
50
50
|
it "should return a rate" do
|
51
|
-
canadian_recipient = {:name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address=>"Address Line 1", :city => "Richmond", :state => "BC", :postal_code => "V7C4V4", :country_code => "CA", :residential => "true" }
|
52
|
-
rates = fedex.rate({:shipper => shipper, :recipient => canadian_recipient, :packages => packages, :service_type => "FEDEX_GROUND"})
|
51
|
+
canadian_recipient = { :name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address=>"Address Line 1", :city => "Richmond", :state => "BC", :postal_code => "V7C4V4", :country_code => "CA", :residential => "true" }
|
52
|
+
rates = fedex.rate({ :shipper => shipper, :recipient => canadian_recipient, :packages => packages, :service_type => "FEDEX_GROUND" })
|
53
53
|
rates.first.should be_an_instance_of(Rate)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
context "canadian shipment including customs", :vcr do
|
58
58
|
it "should return a rate including international fees" do
|
59
|
-
canadian_recipient = {:name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address=>"Address Line 1", :city => "Richmond", :state => "BC", :postal_code => "V7C4V4", :country_code => "CA", :residential => "true" }
|
59
|
+
canadian_recipient = { :name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address=>"Address Line 1", :city => "Richmond", :state => "BC", :postal_code => "V7C4V4", :country_code => "CA", :residential => "true" }
|
60
60
|
broker = {
|
61
61
|
:account_number => "510087143",
|
62
62
|
:tins => { :tin_type => "BUSINESS_NATIONAL",
|
@@ -121,10 +121,10 @@ module Fedex
|
|
121
121
|
:description => "Cotton Coat",
|
122
122
|
:country_of_manufacture => "US",
|
123
123
|
:harmonized_code => "6103320000",
|
124
|
-
:weight => {:units => "LB", :value => "2"},
|
124
|
+
:weight => { :units => "LB", :value => "2" },
|
125
125
|
:quantity => "3",
|
126
|
-
:unit_price => {:currency => "USD", :amount => "50" },
|
127
|
-
:customs_value => {:currency => "USD", :amount => "150" }
|
126
|
+
:unit_price => { :currency => "USD", :amount => "50" },
|
127
|
+
:customs_value => { :currency => "USD", :amount => "150" }
|
128
128
|
},
|
129
129
|
{
|
130
130
|
:name => "Poster",
|
@@ -132,15 +132,15 @@ module Fedex
|
|
132
132
|
:description => "Paper Poster",
|
133
133
|
:country_of_manufacture => "US",
|
134
134
|
:harmonized_code => "4817100000",
|
135
|
-
:weight => {:units => "LB", :value => "0.2"},
|
135
|
+
:weight => { :units => "LB", :value => "0.2" },
|
136
136
|
:quantity => "3",
|
137
|
-
:unit_price => {:currency => "USD", :amount => "50" },
|
138
|
-
:customs_value => {:currency => "USD", :amount => "150" }
|
137
|
+
:unit_price => { :currency => "USD", :amount => "50" },
|
138
|
+
:customs_value => { :currency => "USD", :amount => "150" }
|
139
139
|
}
|
140
140
|
]
|
141
141
|
|
142
142
|
customs_clearance = { :broker => broker, :clearance_brokerage => clearance_brokerage, :importer_of_record => importer_of_record, :recipient_customs_id => recipient_customs_id, :duties_payment => duties_payment, :commodities => commodities }
|
143
|
-
rates = fedex.rate({:shipper => shipper, :recipient => canadian_recipient, :packages => packages, :service_type => "FEDEX_GROUND", :customs_clearance => customs_clearance})
|
143
|
+
rates = fedex.rate({ :shipper => shipper, :recipient => canadian_recipient, :packages => packages, :service_type => "FEDEX_GROUND", :customs_clearance => customs_clearance })
|
144
144
|
rates.first.should be_an_instance_of(Rate)
|
145
145
|
end
|
146
146
|
end
|
@@ -5,10 +5,10 @@ describe Fedex::Request::Shipment do
|
|
5
5
|
describe "ship service" do
|
6
6
|
let(:fedex) { Fedex::Shipment.new(fedex_credentials) }
|
7
7
|
let(:shipper) do
|
8
|
-
{:name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Harrison", :state => "AR", :postal_code => "72601", :country_code => "US"}
|
8
|
+
{ :name => "Sender", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Harrison", :state => "AR", :postal_code => "72601", :country_code => "US" }
|
9
9
|
end
|
10
10
|
let(:recipient) do
|
11
|
-
{:name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
11
|
+
{ :name => "Recipient", :company => "Company", :phone_number => "555-555-5555", :address => "Main Street", :city => "Frankin Park", :state => "IL", :postal_code => "60131", :country_code => "US", :residential => true }
|
12
12
|
end
|
13
13
|
let(:packages) do
|
14
14
|
[
|
@@ -32,7 +32,7 @@ describe Fedex::Request::Shipment do
|
|
32
32
|
|
33
33
|
context "domestic shipment", :vcr do
|
34
34
|
let(:options) do
|
35
|
-
{:shipper => shipper, :recipient => recipient, :packages => packages, :service_type => "FEDEX_GROUND", :filename => filename}
|
35
|
+
{ :shipper => shipper, :recipient => recipient, :packages => packages, :service_type => "FEDEX_GROUND", :filename => filename }
|
36
36
|
end
|
37
37
|
|
38
38
|
it "succeeds" do
|
@@ -55,7 +55,7 @@ describe Fedex::Request::Shipment do
|
|
55
55
|
|
56
56
|
context 'without service_type specified', :vcr do
|
57
57
|
let(:options) do
|
58
|
-
{:shipper => shipper, :recipient => recipient, :packages => packages, :filename => filename}
|
58
|
+
{ :shipper => shipper, :recipient => recipient, :packages => packages, :filename => filename }
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'raises error' do
|
@@ -67,7 +67,7 @@ describe Fedex::Request::Shipment do
|
|
67
67
|
|
68
68
|
context 'with invalid payment_options' do
|
69
69
|
let(:options) do
|
70
|
-
{:shipper => shipper, :recipient => recipient, :packages => packages, :filename => filename, :payment_options => payment_options.merge(:account_number => nil)}
|
70
|
+
{ :shipper => shipper, :recipient => recipient, :packages => packages, :filename => filename, :payment_options => payment_options.merge(:account_number => nil) }
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'raises error' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70315271490960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.13.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70315271490960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70315271490460 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70315271490460
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70315271489980 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.9.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70315271489980
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: vcr
|
49
|
-
requirement: &
|
49
|
+
requirement: &70315271489520 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70315271489520
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: webmock
|
60
|
-
requirement: &
|
60
|
+
requirement: &70315271489040 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.8.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70315271489040
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
|
-
requirement: &
|
71
|
+
requirement: &70315271488620 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,9 +76,8 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
description: Provides an interface to Fedex Web Services
|
81
|
-
generate labels and address validation
|
79
|
+
version_requirements: *70315271488620
|
80
|
+
description: Provides an interface to Fedex Web Services
|
82
81
|
email:
|
83
82
|
- jazminschroeder@gmail.com
|
84
83
|
executables: []
|