dji 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c537b14753592e862427e2acff55711db4a3493
4
- data.tar.gz: 3da898f5726aa3372edcb7f73d2593ed461b0f60
3
+ metadata.gz: ac4d3c2e2f51ce0c4fb263671436ce1a2eb8855b
4
+ data.tar.gz: 3d19374aa18e5d02466fc90880203f9bb4eb24ea
5
5
  SHA512:
6
- metadata.gz: ffe1d34948ae6d308009980cb6eda2070aaa80fcae158c74785368bf158b91e37ba4cc461c1d7a9714ae43fa8bfc689cf8c1edf34ad73f6f3f074f8a5c7ce14d
7
- data.tar.gz: dd535a177f5cb221fcba32bcad0f29c0a5fdae547c7281e36dcd9a8fa49b15bb9216a401a42028e2a6964468f112cc301b213d2f1b098645ba86b895dc0e394f
6
+ metadata.gz: 2fced0e4e657e724cdeb72f51256e7123b851045acd8f4aaca0b67038437a2004325362f5effcb554add203b2c29191feef8a96b340a78d01a9548be77f8ad92
7
+ data.tar.gz: 578cac5d9c6cc37809a61fa0ec64f148328b929df771a544fb61a20b8ea6050a942480c144d016ae1915b91fabcb31fc6eebad5c85b857b98f0df49748a7b088
data/README.md CHANGED
@@ -54,6 +54,88 @@ If you want this to repeat automatically at an interval, specify the option for
54
54
  Shipping Company : Tba
55
55
  Tracking Number :
56
56
 
57
+ ### Search FedEx and track by reference
58
+
59
+ If you think your shipper is FedEx but you don't have a tracking code yet, you might be able to find your shipment by
60
+ searching Fedex by reference. This allows you to search and track by reference.
61
+
62
+ $ dji track -c COUNTRY_CODE -p POSTAL_CODE
63
+
64
+ An example of searching in the USA (country code is us) with a postal code:
65
+
66
+ $ dji fedex -c us -p 94123
67
+
68
+ FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:44:37 -0700
69
+ -------------------------------------------------------------------------------------------------------
70
+
71
+ PACKAGE 1
72
+
73
+ Origin : SHENZHEN, CN
74
+ Destination : San Francisco, CA, US
75
+ Tendered :
76
+ Picked Up :
77
+ Shipped : 2016-10-27 00:00:00 -0600
78
+ Est. Deliver : 2016-10-31 10:30:00 -0700
79
+ Dimensions : 22x34x16 cms
80
+ Total Weight : 9.7 lbs (4.4 kgs)
81
+ Status : Label created
82
+
83
+ If you want to search by a different reference, you can optionally pass it in:
84
+
85
+ $ dji fedex -c us -p 94123 --reference DJIGOODS
86
+
87
+ FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:50:57 -0700
88
+ -------------------------------------------------------------------------------------------------------
89
+
90
+ PACKAGE 1
91
+
92
+ Origin : SHENZHEN, CN
93
+ Destination : San Francisco, CA, US
94
+ Tendered :
95
+ Picked Up :
96
+ Shipped : 2016-10-27 00:00:00 -0600
97
+ Est. Deliver : 2016-10-31 10:30:00 -0700
98
+ Dimensions : 22x34x16 cms
99
+ Total Weight : 9.7 lbs (4.4 kgs)
100
+ Status : Label created
101
+
102
+ You may also have it repeat the search on a regular interval (in seconds):
103
+
104
+ $ dji fedex -c us -p 94123 -r 120
105
+
106
+ Requesting FedEx tracking by reference DJIGOODS every 120 seconds. Press CONTROL-C to stop...
107
+
108
+ FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:53:41 -0700
109
+ -------------------------------------------------------------------------------------------------------
110
+
111
+ PACKAGE 1
112
+
113
+ Origin : SHENZHEN, CN
114
+ Destination : San Francisco, CA, US
115
+ Tendered :
116
+ Picked Up :
117
+ Shipped : 2016-10-27 00:00:00 -0600
118
+ Est. Deliver : 2016-10-31 10:30:00 -0700
119
+ Dimensions : 22x34x16 cms
120
+ Total Weight : 9.7 lbs (4.4 kgs)
121
+ Status : Label created
122
+
123
+
124
+ FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:55:42 -0700
125
+ -------------------------------------------------------------------------------------------------------
126
+
127
+ PACKAGE 1
128
+
129
+ Origin : SHENZHEN, CN
130
+ Destination : San Francisco, CA, US
131
+ Tendered :
132
+ Picked Up :
133
+ Shipped : 2016-10-27 00:00:00 -0600
134
+ Est. Deliver : 2016-10-31 10:30:00 -0700
135
+ Dimensions : 22x34x16 cms
136
+ Total Weight : 9.7 lbs (4.4 kgs)
137
+ Status : Label created
138
+
57
139
  ## Development
58
140
 
59
141
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -4,14 +4,14 @@ module DJI
4
4
  desc 'fedex COUNTRY_CODE POSTAL_CODE', 'track FedEx by reference'
5
5
  option :country_code, required: true, aliases: :c
6
6
  option :postal_code, required: true, aliases: :p
7
- option :reference, aliases: :ref, default: 'DJIGOODS'
8
- option :repeat, aliases: :r
7
+ option :reference, required: false, aliases: :ref, default: 'DJIGOODS'
8
+ option :repeat, required: false, aliases: :r
9
9
 
10
10
  def fedex
11
11
  if options[:repeat].present?
12
12
  interval = options[:repeat].to_i.presence || 300
13
13
  puts
14
- puts "Requesting FedEx tracking by reference #{reference} every #{interval} seconds. Press CONTROL-C to stop..."
14
+ puts "Requesting FedEx tracking by reference #{options[:reference]} every #{interval} seconds. Press CONTROL-C to stop..."
15
15
 
16
16
  while true
17
17
  DJI::Fedex.track_by_reference(options[:country_code], options[:postal_code], options[:reference])
@@ -1,3 +1,3 @@
1
1
  module DJI
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Elliott