after_ship 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,443 @@
1
+ {
2
+ "meta": {
3
+ "code": 200
4
+ },
5
+ "data": {
6
+ "tracking": {
7
+ "created_at": "2014-07-22T05:11:40+00:00",
8
+ "updated_at": "2014-07-31T06:33:05+00:00",
9
+ "tracking_number": "9405903699300211343566",
10
+ "slug": "usps",
11
+ "active": true,
12
+ "custom_fields": {
13
+ },
14
+ "customer_name": null,
15
+ "destination_country_iso3": null,
16
+ "emails": [
17
+
18
+ ],
19
+ "expected_delivery": "2014-07-02T00:00:00",
20
+ "order_id": null,
21
+ "order_id_path": null,
22
+ "origin_country_iso3": null,
23
+ "shipment_package_count": 1,
24
+ "shipment_type": "Priority Mail 2-Day™",
25
+ "signed_by": "",
26
+ "smses": [
27
+
28
+ ],
29
+ "source": "web",
30
+ "tag": "InTransit",
31
+ "title": "9405903699300211343566",
32
+ "tracked_count": 97,
33
+ "unique_token": "-kqZ9ebYl",
34
+ "checkpoints": [
35
+ {
36
+ "slug": "usps",
37
+ "city": "",
38
+ "created_at": "2014-07-22T05:11:46+00:00",
39
+ "country_name": "",
40
+ "message": "Electronic Shipping Info Received",
41
+ "country_iso3": null,
42
+ "tag": "InfoReceived",
43
+ "checkpoint_time": "2014-06-29T00:00:01",
44
+ "coordinates": [
45
+
46
+ ],
47
+ "state": "",
48
+ "zip": ""
49
+ },
50
+ {
51
+ "slug": "usps",
52
+ "city": "",
53
+ "created_at": "2014-07-28T09:52:59+00:00",
54
+ "country_name": "",
55
+ "message": "Pre-Shipment Info Sent to USPS",
56
+ "country_iso3": null,
57
+ "tag": "InTransit",
58
+ "checkpoint_time": "2014-06-29T00:00:01",
59
+ "coordinates": [
60
+
61
+ ],
62
+ "state": "",
63
+ "zip": ""
64
+ },
65
+ {
66
+ "slug": "usps",
67
+ "city": "NORTH BRANCH",
68
+ "created_at": "2014-07-22T05:11:46+00:00",
69
+ "country_name": "",
70
+ "message": "Acceptance",
71
+ "country_iso3": null,
72
+ "tag": "InTransit",
73
+ "checkpoint_time": "2014-06-30T14:03:00",
74
+ "coordinates": [
75
+
76
+ ],
77
+ "state": "MN",
78
+ "zip": "55056"
79
+ },
80
+ {
81
+ "slug": "usps",
82
+ "city": "NORTH BRANCH",
83
+ "created_at": "2014-07-28T09:52:59+00:00",
84
+ "country_name": "",
85
+ "message": "Departed Post Office",
86
+ "country_iso3": null,
87
+ "tag": "InTransit",
88
+ "checkpoint_time": "2014-06-30T16:35:00",
89
+ "coordinates": [
90
+
91
+ ],
92
+ "state": "MN",
93
+ "zip": "55056"
94
+ },
95
+ {
96
+ "slug": "usps",
97
+ "city": "NORTH BRANCH",
98
+ "created_at": "2014-07-22T05:11:46+00:00",
99
+ "country_name": "",
100
+ "message": "Depart Post Office",
101
+ "country_iso3": null,
102
+ "tag": "InTransit",
103
+ "checkpoint_time": "2014-06-30T16:35:00",
104
+ "coordinates": [
105
+
106
+ ],
107
+ "state": "MN",
108
+ "zip": "55056"
109
+ },
110
+ {
111
+ "slug": "usps",
112
+ "city": "SAINT PAUL",
113
+ "created_at": "2014-07-22T05:11:46+00:00",
114
+ "country_name": "",
115
+ "message": "Processed at USPS Origin Sort Facility",
116
+ "country_iso3": null,
117
+ "tag": "InTransit",
118
+ "checkpoint_time": "2014-06-30T20:20:00",
119
+ "coordinates": [
120
+
121
+ ],
122
+ "state": "MN",
123
+ "zip": "55121"
124
+ },
125
+ {
126
+ "slug": "usps",
127
+ "city": "SAINT PAUL",
128
+ "created_at": "2014-07-28T09:52:59+00:00",
129
+ "country_name": "",
130
+ "message": "Arrived at USPS Origin Facility",
131
+ "country_iso3": null,
132
+ "tag": "InTransit",
133
+ "checkpoint_time": "2014-06-30T20:20:00",
134
+ "coordinates": [
135
+
136
+ ],
137
+ "state": "MN",
138
+ "zip": "55121"
139
+ },
140
+ {
141
+ "slug": "usps",
142
+ "city": "SAINT PAUL",
143
+ "created_at": "2014-07-22T05:11:46+00:00",
144
+ "country_name": "",
145
+ "message": "Depart USPS Sort Facility",
146
+ "country_iso3": null,
147
+ "tag": "InTransit",
148
+ "checkpoint_time": "2014-07-01T01:25:00",
149
+ "coordinates": [
150
+
151
+ ],
152
+ "state": "MN",
153
+ "zip": "55121"
154
+ },
155
+ {
156
+ "slug": "usps",
157
+ "city": "SAINT PAUL",
158
+ "created_at": "2014-07-28T09:52:59+00:00",
159
+ "country_name": "",
160
+ "message": "Departed USPS Facility",
161
+ "country_iso3": null,
162
+ "tag": "InTransit",
163
+ "checkpoint_time": "2014-07-01T01:25:00",
164
+ "coordinates": [
165
+
166
+ ],
167
+ "state": "MN",
168
+ "zip": "55121"
169
+ },
170
+ {
171
+ "slug": "usps",
172
+ "city": "BETHPAGE",
173
+ "created_at": "2014-07-22T05:11:46+00:00",
174
+ "country_name": "",
175
+ "message": "Processed through USPS Sort Facility",
176
+ "country_iso3": null,
177
+ "tag": "InTransit",
178
+ "checkpoint_time": "2014-07-02T02:04:00",
179
+ "coordinates": [
180
+
181
+ ],
182
+ "state": "NY",
183
+ "zip": "11714"
184
+ },
185
+ {
186
+ "slug": "usps",
187
+ "city": "BETHPAGE",
188
+ "created_at": "2014-07-28T09:52:59+00:00",
189
+ "country_name": "",
190
+ "message": "Arrived at USPS Facility",
191
+ "country_iso3": null,
192
+ "tag": "InTransit",
193
+ "checkpoint_time": "2014-07-02T02:04:00",
194
+ "coordinates": [
195
+
196
+ ],
197
+ "state": "NY",
198
+ "zip": "11714"
199
+ },
200
+ {
201
+ "slug": "usps",
202
+ "city": "BETHPAGE",
203
+ "created_at": "2014-07-22T05:11:46+00:00",
204
+ "country_name": "",
205
+ "message": "Depart USPS Sort Facility",
206
+ "country_iso3": null,
207
+ "tag": "InTransit",
208
+ "checkpoint_time": "2014-07-02T04:03:00",
209
+ "coordinates": [
210
+
211
+ ],
212
+ "state": "NY",
213
+ "zip": "11714"
214
+ },
215
+ {
216
+ "slug": "usps",
217
+ "city": "BETHPAGE",
218
+ "created_at": "2014-07-28T09:52:59+00:00",
219
+ "country_name": "",
220
+ "message": "Departed USPS Facility",
221
+ "country_iso3": null,
222
+ "tag": "InTransit",
223
+ "checkpoint_time": "2014-07-02T04:03:00",
224
+ "coordinates": [
225
+
226
+ ],
227
+ "state": "NY",
228
+ "zip": "11714"
229
+ },
230
+ {
231
+ "slug": "usps",
232
+ "city": "BRONX",
233
+ "created_at": "2014-07-28T09:52:59+00:00",
234
+ "country_name": "",
235
+ "message": "Arrived at Post Office",
236
+ "country_iso3": null,
237
+ "tag": "InTransit",
238
+ "checkpoint_time": "2014-07-02T07:28:00",
239
+ "coordinates": [
240
+
241
+ ],
242
+ "state": "NY",
243
+ "zip": "10461"
244
+ },
245
+ {
246
+ "slug": "usps",
247
+ "city": "BRONX",
248
+ "created_at": "2014-07-22T05:11:46+00:00",
249
+ "country_name": "",
250
+ "message": "Arrival at Post Office",
251
+ "country_iso3": null,
252
+ "tag": "InTransit",
253
+ "checkpoint_time": "2014-07-02T07:28:00",
254
+ "coordinates": [
255
+
256
+ ],
257
+ "state": "NY",
258
+ "zip": "10461"
259
+ },
260
+ {
261
+ "slug": "usps",
262
+ "city": "BRONX",
263
+ "created_at": "2014-07-22T05:11:46+00:00",
264
+ "country_name": "",
265
+ "message": "Sorting Complete",
266
+ "country_iso3": null,
267
+ "tag": "InTransit",
268
+ "checkpoint_time": "2014-07-02T07:53:00",
269
+ "coordinates": [
270
+
271
+ ],
272
+ "state": "NY",
273
+ "zip": "10461"
274
+ },
275
+ {
276
+ "slug": "usps",
277
+ "city": "BRONX",
278
+ "created_at": "2014-07-22T05:11:46+00:00",
279
+ "country_name": "",
280
+ "message": "Out for Delivery",
281
+ "country_iso3": null,
282
+ "tag": "OutForDelivery",
283
+ "checkpoint_time": "2014-07-02T08:03:00",
284
+ "coordinates": [
285
+
286
+ ],
287
+ "state": "NY",
288
+ "zip": "10461"
289
+ },
290
+ {
291
+ "slug": "usps",
292
+ "city": "BRONX",
293
+ "created_at": "2014-07-22T05:11:46+00:00",
294
+ "country_name": "",
295
+ "message": "Notice Left (No Authorized Recipient Available)",
296
+ "country_iso3": null,
297
+ "tag": "AttemptFail",
298
+ "checkpoint_time": "2014-07-02T16:21:00",
299
+ "coordinates": [
300
+
301
+ ],
302
+ "state": "NY",
303
+ "zip": "10461"
304
+ },
305
+ {
306
+ "slug": "usps",
307
+ "city": "BRONX",
308
+ "created_at": "2014-07-22T05:11:46+00:00",
309
+ "country_name": "",
310
+ "message": "Available for Pickup",
311
+ "country_iso3": null,
312
+ "tag": "InTransit",
313
+ "checkpoint_time": "2014-07-02T18:31:00",
314
+ "coordinates": [
315
+
316
+ ],
317
+ "state": "NY",
318
+ "zip": "10461"
319
+ },
320
+ {
321
+ "slug": "usps",
322
+ "city": "BRONX",
323
+ "created_at": "2014-07-22T05:11:46+00:00",
324
+ "country_name": "",
325
+ "message": "Unclaimed",
326
+ "country_iso3": null,
327
+ "tag": "Exception",
328
+ "checkpoint_time": "2014-07-19T09:26:00",
329
+ "coordinates": [
330
+
331
+ ],
332
+ "state": "NY",
333
+ "zip": "10461"
334
+ },
335
+ {
336
+ "slug": "usps",
337
+ "city": "KEARNY",
338
+ "created_at": "2014-07-28T09:52:59+00:00",
339
+ "country_name": "",
340
+ "message": "Arrived at USPS Facility",
341
+ "country_iso3": null,
342
+ "tag": "InTransit",
343
+ "checkpoint_time": "2014-07-23T08:11:00",
344
+ "coordinates": [
345
+
346
+ ],
347
+ "state": "NJ",
348
+ "zip": "07032"
349
+ },
350
+ {
351
+ "slug": "usps",
352
+ "city": "KEARNY",
353
+ "created_at": "2014-07-23T12:40:21+00:00",
354
+ "country_name": "",
355
+ "message": "Processed through USPS Sort Facility",
356
+ "country_iso3": null,
357
+ "tag": "InTransit",
358
+ "checkpoint_time": "2014-07-23T08:16:00",
359
+ "coordinates": [
360
+
361
+ ],
362
+ "state": "NJ",
363
+ "zip": "07032"
364
+ },
365
+ {
366
+ "slug": "usps",
367
+ "city": "KEARNY",
368
+ "created_at": "2014-07-23T16:56:25+00:00",
369
+ "country_name": "",
370
+ "message": "Processed through USPS Sort Facility",
371
+ "country_iso3": null,
372
+ "tag": "InTransit",
373
+ "checkpoint_time": "2014-07-23T12:18:00",
374
+ "coordinates": [
375
+
376
+ ],
377
+ "state": "NJ",
378
+ "zip": "07032"
379
+ },
380
+ {
381
+ "slug": "usps",
382
+ "city": "KEARNY",
383
+ "created_at": "2014-07-28T09:52:59+00:00",
384
+ "country_name": "",
385
+ "message": "Departed USPS Facility",
386
+ "country_iso3": null,
387
+ "tag": "InTransit",
388
+ "checkpoint_time": "2014-07-23T12:18:00",
389
+ "coordinates": [
390
+
391
+ ],
392
+ "state": "NJ",
393
+ "zip": "07032"
394
+ },
395
+ {
396
+ "slug": "usps",
397
+ "city": "BETHPAGE",
398
+ "created_at": "2014-07-28T09:52:59+00:00",
399
+ "country_name": "",
400
+ "message": "Arrived at USPS Facility",
401
+ "country_iso3": null,
402
+ "tag": "InTransit",
403
+ "checkpoint_time": "2014-07-23T17:29:00",
404
+ "coordinates": [
405
+
406
+ ],
407
+ "state": "NY",
408
+ "zip": "11714"
409
+ },
410
+ {
411
+ "slug": "usps",
412
+ "city": "BETHPAGE",
413
+ "created_at": "2014-07-23T21:40:24+00:00",
414
+ "country_name": "",
415
+ "message": "Processed through USPS Sort Facility",
416
+ "country_iso3": null,
417
+ "tag": "InTransit",
418
+ "checkpoint_time": "2014-07-23T17:30:00",
419
+ "coordinates": [
420
+
421
+ ],
422
+ "state": "NY",
423
+ "zip": "11714"
424
+ },
425
+ {
426
+ "slug": "usps",
427
+ "city": "BETHPAGE",
428
+ "created_at": "2014-07-28T09:52:59+00:00",
429
+ "country_name": "",
430
+ "message": "Departed USPS Facility",
431
+ "country_iso3": null,
432
+ "tag": "InTransit",
433
+ "checkpoint_time": "2014-07-23T17:30:00",
434
+ "coordinates": [
435
+
436
+ ],
437
+ "state": "NY",
438
+ "zip": "11714"
439
+ }
440
+ ]
441
+ }
442
+ }
443
+ }
@@ -0,0 +1,13 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'simplecov'
4
+ require 'webmock' # Disable all HTTP access
5
+ require 'multi_json'
6
+
7
+ # Coverage tool, needs to be started as soon as possible
8
+ SimpleCov.start do
9
+ add_filter '/spec/' # Ignore spec directory
10
+ end
11
+
12
+ require 'after_ship'
13
+ require 'request_stubs'
metadata ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: after_ship
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Oldrich Vetesnik
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: webmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.19'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.19'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.9'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.9'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.26'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.26'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.10'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.8'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.8'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '10.3'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.3'
125
+ - !ruby/object:Gem::Dependency
126
+ name: typhoeus
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.6'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.6'
139
+ - !ruby/object:Gem::Dependency
140
+ name: multi_json
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.10'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.10'
153
+ description:
154
+ email:
155
+ - oldrich.vetesnik@gmail.com
156
+ executables: []
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - ".gitignore"
161
+ - ".rspec"
162
+ - ".rubocop-my.yml"
163
+ - ".rubocop.yml"
164
+ - ".travis.yml"
165
+ - ".yardopts"
166
+ - Gemfile
167
+ - LICENSE.txt
168
+ - README.md
169
+ - Rakefile
170
+ - after_ship.gemspec
171
+ - lib/after_ship.rb
172
+ - lib/after_ship/checkpoint.rb
173
+ - lib/after_ship/tracking.rb
174
+ - lib/after_ship/version.rb
175
+ - lib/attributes.rb
176
+ - lib/date_utils.rb
177
+ - spec/lib/after_ship_spec.rb
178
+ - spec/lib/checkpoint_spec.rb
179
+ - spec/lib/date_utils_spec.rb
180
+ - spec/lib/tracking_spec.rb
181
+ - spec/request_stubs.rb
182
+ - spec/requests/tracking/delivered_ok.json
183
+ - spec/requests/tracking/delivered_wild.json
184
+ - spec/requests/tracking/in_transit.json
185
+ - spec/spec_helper.rb
186
+ homepage: https://github.com/ollie/after_ship
187
+ licenses:
188
+ - MIT
189
+ metadata: {}
190
+ post_install_message:
191
+ rdoc_options: []
192
+ require_paths:
193
+ - lib
194
+ required_ruby_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ requirements: []
205
+ rubyforge_project:
206
+ rubygems_version: 2.4.2
207
+ signing_key:
208
+ specification_version: 4
209
+ summary: A smallish library to talking to AfterShip via v3 API.
210
+ test_files:
211
+ - spec/lib/after_ship_spec.rb
212
+ - spec/lib/checkpoint_spec.rb
213
+ - spec/lib/date_utils_spec.rb
214
+ - spec/lib/tracking_spec.rb
215
+ - spec/request_stubs.rb
216
+ - spec/requests/tracking/delivered_ok.json
217
+ - spec/requests/tracking/delivered_wild.json
218
+ - spec/requests/tracking/in_transit.json
219
+ - spec/spec_helper.rb
220
+ has_rdoc: