dji 0.3.9 → 0.4.0

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: d6c7466dc976d6bab33aa9d69de6c9aa92145f6e
4
- data.tar.gz: 0222e16f71c237dfedb3932dd334f352a11a9890
3
+ metadata.gz: 5aeb8cd99478d19c5f62866970aa376e4af9b89b
4
+ data.tar.gz: 004f57e75bb00eac9fd1fcb30b44958fefcdc093
5
5
  SHA512:
6
- metadata.gz: 87e29875f092a73d57e8831f1e8c85b0b0fb4ba9ecef1829aba29d9755c2fd316ebc96d0db313b4904a86f12598b37e6c082dde89b0b7a97f19448a6dd34c45e
7
- data.tar.gz: a93faf41a6518d1e0374b6617d4f08acff7bbb2f927007870ed8d4396a689c6a8f246beaccbcad9229204e397415b774f1ba6a4067e525e826073848bdc9fae3
6
+ metadata.gz: 1374f48557599191d8717959f744e7304dc03bba55ea1b51415968bcde4428b517793850e5d60ab7b6c390d25a0b69b950eebbbc384a1a0c1c436b523d1b779e
7
+ data.tar.gz: e8a75a552de1f4870d516658e687303008172d8e89fc86e9db33d6942b9c2e0c9a40ffeca789a1fc40991750ce53f7abb7580c1e6bd51b19d9c68c0177ef3c50
data/README.md CHANGED
@@ -30,14 +30,18 @@ If you are on Ubuntu Linux, you can do:
30
30
  ```
31
31
  $ dji track [options]
32
32
 
33
- OPTIONS:
33
+ REQUIRED:
34
34
 
35
35
  -o, --order ORDER_NUMBER # Your order number
36
36
  -p, --phone PHONE_TAIL # Last 4 digits of your phone number
37
+
38
+ OPTIONAL:
39
+
37
40
  -r, --repeat INTERVAL # Optional: Repat every INTERVAL seconds
38
41
  --publish # Optional: Publish your order details to http://dji-track.herokuapp.com/orders
39
42
   -c, --country COUNTRY # Optional: Your country (use 3 letter code, such as USA)
40
43
  -u, --dji_username USERNAME # Optional: Your DJI Forum username
44
+ -d, --debug # Optional: Some additional output for when emailing kevin@welikeinc.com for assistance
41
45
  ```
42
46
 
43
47
  #### Example: Track an order
@@ -96,10 +100,10 @@ If you want this to repeat automatically at an interval, specify the option for
96
100
  Shipping Status : Pending
97
101
  Shipping Company : Tba
98
102
  Tracking Number :
99
-
103
+
100
104
  You have successfully published your latest order status.
101
105
  See order statuses reported by others at http://dji-track.herokuapp.com/orders
102
-
106
+
103
107
  ORDER TRACKING AS OF 2016-10-27 01:17:28 -0700
104
108
  ------------------------------------------------------
105
109
  DJI Forum Username : dronenerd
@@ -110,7 +114,7 @@ If you want this to repeat automatically at an interval, specify the option for
110
114
  Shipping Status : Pending
111
115
  Shipping Company : Tba
112
116
  Tracking Number :
113
-
117
+
114
118
  You have successfully published your latest order status.
115
119
  See order statuses reported by others at http://dji-track.herokuapp.com/orders
116
120
 
@@ -1,20 +1,27 @@
1
+ require 'time'
2
+
1
3
  module DJI
2
4
  module Command
3
5
  class TrackCommand < Base
4
6
  desc 'track ORDER_NUMBER PHONE_TAIL', 'track an order'
5
7
  option :order_number, required: true, aliases: :o
6
8
  option :phone_tail, required: true, aliases: :p
7
- option :repeat, aliases: :r
9
+
10
+ option :repeat, required: false, aliases: :r
8
11
  option :publish, required: false, default: false
9
-
12
+
10
13
  option :country, required: false, aliases: :c
11
14
  option :debug, required: false, default: false, aliases: :d
12
15
  option :dji_username, required: false, aliases: [:username, :u]
16
+ option :order_time, required: false, aliases: :t
13
17
  option :email_address, required: false, aliases: [:email, :e]
14
18
 
15
19
  def track
20
+ order_time = Time.parse(options[:order_time]) if options[:order_time].present?
21
+
16
22
  provided_options = {
17
23
  order_number: options[:order_number],
24
+ order_time: order_time,
18
25
  phone_tail: options[:phone_tail],
19
26
  country: options[:country],
20
27
  debug: options[:debug],
@@ -75,6 +75,7 @@ module DJI
75
75
  data[:email_address] = options[:email_address] if options[:email_address].present?
76
76
  data[:debug] = options[:debug] if options[:debug].present?
77
77
  data[:dji_username] = options[:dji_username] if options[:dji_username].present?
78
+ data[:order_time] = options[:order_time] if options[:order_time].present?
78
79
  data[:shipping_country] = options[:country] if options[:country].present?
79
80
 
80
81
  print_tracking_details(data)
@@ -98,11 +99,12 @@ module DJI
98
99
  puts
99
100
  puts "ORDER TRACKING AS OF #{now}"
100
101
  puts "------------------------------------------------------"
101
- puts "DJI Forum Username : #{data[:dji_username]}" if data[:dji_username]
102
+ puts "DJI Forum Username : #{data[:dji_username]}" if data[:dji_username].present?
102
103
  puts "Order Number : #{data[:order_number]}"
104
+ puts "Order Time : #{data[:order_time]}" if data[:order_time].present?
103
105
  puts "Total : #{data[:total]}"
104
106
  puts "Payment Status : #{data[:payment_status]}"
105
- puts "Country : #{data[:shipping_country]}" if data[:shipping_country]
107
+ puts "Country : #{data[:shipping_country]}" if data[:shipping_country].present?
106
108
  puts "Shipping Status : #{data[:shipping_status]}"
107
109
  puts "Shipping Company : #{data[:shipping_company]}"
108
110
  puts "Tracking Number : #{data[:tracking_number]}"
@@ -116,6 +118,7 @@ module DJI
116
118
  order: {
117
119
  merchant: 'DJI',
118
120
  order_id: data[:order_number],
121
+ order_time: data[:order_time],
119
122
  payment_status: data[:payment_status],
120
123
  payment_total: data[:total],
121
124
  shipping_country: data[:shipping_country],
@@ -1,3 +1,3 @@
1
1
  module DJI
2
- VERSION = '0.3.9'
2
+ VERSION = '0.4.0'
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.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Elliott