shipsurance 0.1.0 → 0.1.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.
- data/Manifest +1 -0
- data/Rakefile +1 -1
- data/lib/shipsurance/base.rb +107 -0
- data/lib/shipsurance/response.rb +1 -1
- data/shipsurance.gemspec +4 -5
- metadata +4 -4
data/Manifest
CHANGED
data/Rakefile
CHANGED
data/lib/shipsurance/base.rb
CHANGED
@@ -86,6 +86,113 @@ module Shipsurance
|
|
86
86
|
[:ext_person_source_id, :source_username, :source_password, :ext_policy_id]
|
87
87
|
end
|
88
88
|
|
89
|
+
CARRIERS = {
|
90
|
+
"USPS" => 1,
|
91
|
+
"FedEx" => 2,
|
92
|
+
"UPS" => 3,
|
93
|
+
"DHL" => 4,
|
94
|
+
"Canada Post" => 5,
|
95
|
+
"BAX Global" => 6,
|
96
|
+
"Purolator" => 7,
|
97
|
+
"Greyhound GPX" => 8,
|
98
|
+
"Australian Post" => 9,
|
99
|
+
"Common Carrier" => 10,
|
100
|
+
"ICS Courier" => 11,
|
101
|
+
"Royal Mail" => 12,
|
102
|
+
"EMS" => 13,
|
103
|
+
"TNT Express" => 14,
|
104
|
+
"French Postal System" => 15,
|
105
|
+
"Lone Star Overnight" => 16,
|
106
|
+
"Spee-Dee Delivery" => 17,
|
107
|
+
"Golden State Overnight" => 18,
|
108
|
+
"SAIA" => 19,
|
109
|
+
"Overnite Transportation" => 20,
|
110
|
+
"CTI" => 21,
|
111
|
+
"Roadway" => 22,
|
112
|
+
"Highway Freight" => 23,
|
113
|
+
"Yellow Freight" => 24,
|
114
|
+
"American Freight Companies" => 25,
|
115
|
+
"Oak Harbor" => 26,
|
116
|
+
"Pitt Ohio" => 27,
|
117
|
+
"Koch Logistics" => 28,
|
118
|
+
"Old Dominion" => 29,
|
119
|
+
"Estes Express" => 30,
|
120
|
+
"R+L Carriers" => 31,
|
121
|
+
"Eastern Connection" => 32,
|
122
|
+
"Overnite Express" => 33,
|
123
|
+
"California Overnight" => 34,
|
124
|
+
"ABF Freight System" => 35,
|
125
|
+
"UPS Supply Chain Solutions" => 36,
|
126
|
+
"FedEx Freight" => 37,
|
127
|
+
"DHL Danzas" => 38,
|
128
|
+
"Watkins Motor Lines" => 39,
|
129
|
+
"Nebraska Transport Company" => 40,
|
130
|
+
"UPS Mail Innovations" => 41,
|
131
|
+
"AAA Cooper" => 42,
|
132
|
+
"Central Freight Lines" => 43,
|
133
|
+
"Dayton Freight Lines" => 44,
|
134
|
+
"Eagle Global Logistics" => 45,
|
135
|
+
"New Penn" => 46,
|
136
|
+
"Pilot Air Freight" => 47,
|
137
|
+
"Roadrunner Dawes Freight" => 48,
|
138
|
+
"SEKO Worldwide" => 49,
|
139
|
+
"Southeastern Freight Lines" => 50,
|
140
|
+
"Target Logistic Services" => 51,
|
141
|
+
"Vitran Express" => 52,
|
142
|
+
"United Van Lines" => 53,
|
143
|
+
"Bekins" => 54,
|
144
|
+
"HomeDirectUSA" => 55,
|
145
|
+
"IMEX" => 56,
|
146
|
+
"UPS Freight" => 57,
|
147
|
+
"USF Holland" => 58,
|
148
|
+
"USF Reddaway" => 59,
|
149
|
+
"Averitt Express" => 60,
|
150
|
+
"STI" => 61,
|
151
|
+
"Parcelforce" => 62,
|
152
|
+
"Pharos" => 63,
|
153
|
+
"YRC Replacing Yellow and Roadway" => 64,
|
154
|
+
"DB Schenker" => 65
|
155
|
+
}
|
156
|
+
|
157
|
+
COMMODITY_CATEGORY_IDS = {
|
158
|
+
"General Merchandise" => 1,
|
159
|
+
"Machinery" => 2,
|
160
|
+
"Household Goods & Personal Effects" => 3,
|
161
|
+
"Fragile Goods/Glass" => 4,
|
162
|
+
"Computers/Electronics" => 5,
|
163
|
+
"Fine Arts" => 6,
|
164
|
+
"Motorcycles/Automobiles" => 7,
|
165
|
+
"Precision Instruments" => 8,
|
166
|
+
"Musical Instruments" => 9,
|
167
|
+
"Chemicals/Hazardous Materials" => 10,
|
168
|
+
"Non Perishable Foods" => 11,
|
169
|
+
"Bottled Beverages" => 12,
|
170
|
+
"Frozen/Chilled Foods (Not Meats)" => 13,
|
171
|
+
"Frozen/Chilled Meats" => 14,
|
172
|
+
"Steel Products" => 15,
|
173
|
+
"Branded Goods" => 16,
|
174
|
+
"Ceramic, Marble, Granite Tiles" => 17,
|
175
|
+
"Watercraft" => 18,
|
176
|
+
"Bagged Commodities" => 19,
|
177
|
+
"Ceramic, Marble, Granite Tiles" => 20,
|
178
|
+
"Lumber" => 21,
|
179
|
+
"Boats/Yachts" => 22
|
180
|
+
}
|
181
|
+
|
182
|
+
COMMODITY_TYPE_IDS = {
|
183
|
+
"New Goods" => 1,
|
184
|
+
"Used Goods" => 2,
|
185
|
+
"Reconditioned Goods" => 3
|
186
|
+
}
|
187
|
+
|
188
|
+
PACKAGE_TYPE_IDS = {
|
189
|
+
"Box" => 1,
|
190
|
+
"Container" => 2,
|
191
|
+
"Crate" => 3,
|
192
|
+
"Pallet" => 4,
|
193
|
+
"Other" => 5
|
194
|
+
}
|
195
|
+
|
89
196
|
private
|
90
197
|
|
91
198
|
def format_date(date, format = "%m/%d/%Y")
|
data/lib/shipsurance/response.rb
CHANGED
@@ -3,7 +3,7 @@ module Shipsurance
|
|
3
3
|
attr_reader :code, :body, :api_response_code, :success, :recorded_shipment_id
|
4
4
|
|
5
5
|
def initialize(response)
|
6
|
-
response_arry = response
|
6
|
+
response_arry = parse(response)
|
7
7
|
@code, @api_response_code, @body, @recorded_shipment_id = response.code.to_i, response_arry[0].to_i, response_arry[1], response_arry[2]
|
8
8
|
@success = (@response_code == 1)
|
9
9
|
self
|
data/shipsurance.gemspec
CHANGED
@@ -2,21 +2,20 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{shipsurance}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Tim Matheson"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-12-01}
|
10
10
|
s.description = %q{Integration gem for the ShipSurance gem}
|
11
11
|
s.email = %q{tim.matheson@ordercup.com}
|
12
12
|
s.extra_rdoc_files = ["lib/extensions/hash.rb", "lib/shipsurance/address.rb", "lib/shipsurance/base.rb", "lib/shipsurance/claim.rb", "lib/shipsurance/person.rb", "lib/shipsurance/record_shipment.rb", "lib/shipsurance/response.rb", "lib/shipsurance/shipsurance.rb", "lib/shipsurance/validation.rb", "lib/shipsurance/void_record_shipment.rb", "lib/shipsurance.rb", "README.rdoc"]
|
13
|
-
s.files = ["config/credentials.example.yml", "config/credentials.yml", "init.rb", "lib/extensions/hash.rb", "lib/shipsurance/address.rb", "lib/shipsurance/base.rb", "lib/shipsurance/claim.rb", "lib/shipsurance/person.rb", "lib/shipsurance/record_shipment.rb", "lib/shipsurance/response.rb", "lib/shipsurance/shipsurance.rb", "lib/shipsurance/validation.rb", "lib/shipsurance/void_record_shipment.rb", "lib/shipsurance.rb", "Rakefile", "README.rdoc", "spec/lib/shipsurance/address_spec.rb", "spec/lib/shipsurance/claim_spec.rb", "spec/lib/shipsurance/person_spec.rb", "spec/lib/shipsurance/record_shipment_spec.rb", "spec/lib/shipsurance/validation_spec.rb", "spec/lib/shipsurance/void_record_shipment_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "Manifest"
|
14
|
-
s.has_rdoc = true
|
13
|
+
s.files = ["config/credentials.example.yml", "config/credentials.yml", "init.rb", "lib/extensions/hash.rb", "lib/shipsurance/address.rb", "lib/shipsurance/base.rb", "lib/shipsurance/claim.rb", "lib/shipsurance/person.rb", "lib/shipsurance/record_shipment.rb", "lib/shipsurance/response.rb", "lib/shipsurance/shipsurance.rb", "lib/shipsurance/validation.rb", "lib/shipsurance/void_record_shipment.rb", "lib/shipsurance.rb", "Rakefile", "README.rdoc", "shipsurance.gemspec", "spec/lib/shipsurance/address_spec.rb", "spec/lib/shipsurance/claim_spec.rb", "spec/lib/shipsurance/person_spec.rb", "spec/lib/shipsurance/record_shipment_spec.rb", "spec/lib/shipsurance/validation_spec.rb", "spec/lib/shipsurance/void_record_shipment_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "Manifest"]
|
15
14
|
s.homepage = %q{http://www.ordercup.com}
|
16
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Shipsurance", "--main", "README.rdoc"]
|
17
16
|
s.require_paths = ["lib"]
|
18
17
|
s.rubyforge_project = %q{shipsurance}
|
19
|
-
s.rubygems_version = %q{1.3.
|
18
|
+
s.rubygems_version = %q{1.3.5}
|
20
19
|
s.summary = %q{Integration gem for the ShipSurance gem}
|
21
20
|
|
22
21
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shipsurance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Matheson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-01 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/shipsurance.rb
|
50
50
|
- Rakefile
|
51
51
|
- README.rdoc
|
52
|
+
- shipsurance.gemspec
|
52
53
|
- spec/lib/shipsurance/address_spec.rb
|
53
54
|
- spec/lib/shipsurance/claim_spec.rb
|
54
55
|
- spec/lib/shipsurance/person_spec.rb
|
@@ -58,7 +59,6 @@ files:
|
|
58
59
|
- spec/spec.opts
|
59
60
|
- spec/spec_helper.rb
|
60
61
|
- Manifest
|
61
|
-
- shipsurance.gemspec
|
62
62
|
has_rdoc: true
|
63
63
|
homepage: http://www.ordercup.com
|
64
64
|
licenses: []
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements: []
|
89
89
|
|
90
90
|
rubyforge_project: shipsurance
|
91
|
-
rubygems_version: 1.3.
|
91
|
+
rubygems_version: 1.3.5
|
92
92
|
signing_key:
|
93
93
|
specification_version: 3
|
94
94
|
summary: Integration gem for the ShipSurance gem
|