us_passport_tracker 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5e8f8a808b8a5dd651bdfa39bb404d4bae6dbc8f48e76e6d65743d454532fb6
4
- data.tar.gz: 8df0f2626775fe1332fdff6f4cb2030d77a639e477244511db27f7a35a20eab7
3
+ metadata.gz: 575a5045d54da2fd87af7aacfb31ba710cd46619a4c11b0bb77eaacbec3e5401
4
+ data.tar.gz: 0504cc5bab75a21730b9fb25f385f8555a2097f7e875858e130e5f9bd9976651
5
5
  SHA512:
6
- metadata.gz: 446b3cc800521faf43672e051516546f9f2b23cdfae242d279e8b845b47c4fafb165584e1b21b9d70a03f52df3b3618ee1fcfe8649ee28da44bb03f3ab71648e
7
- data.tar.gz: dd6150e48270dcb420296dbfbfe60c88a7f2a3516e0f2b13ed6cf1e2c4cef4cbf0499cb71a368348c26cfad7bf0a023b2a92a27ed2bb340f8f33974b3e4bfa46
6
+ metadata.gz: 940743ba196480a4239f866e5e76c5141abe33f3ec2755ebc1facde9e8e8fc7015086ba3dd816540b229c749c81fe1108bcab52c2d8c2ca737b020b07c2da390
7
+ data.tar.gz: '0781d92d304448d50425809199648cf60a267ebd8abe1c2b7d8c97fd88a36677d0127dc0242ccd1e2369ad3818e34a17fb49d8021056196290bc66a504973403'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # USA VISA & Passport Tracker
2
2
 
3
- This is a simple CommandLine tool to check the status of your VISA & Passport collection after its been approved by the US Embassy/Consulate.
3
+ This is a simple CommandLine tool to check the status of your VISA & Passport collection after its been approved by the US Embassy/Consulate. This tool should work for all countries that have a USA Embassy/Consulate, remember to use the **ISO Alpha-2** Country Codes
4
4
 
5
5
  ![alt text](us_passport_tracker_commandline.gif)
6
6
 
@@ -22,29 +22,28 @@ Or install it yourself as:
22
22
 
23
23
  ## Commandline Usage
24
24
 
25
- Installing this gem gives you a nice commandline tool `us_passport_tracker` which you can use to quickly get your VISA status and continue with whatever you were doing.
26
- This tool should work for all countries with a US Embassy/Consulate. Remember to use the full Country Name
25
+ Installing this gem gives you a nice commandline tool `uspasstracker` which you can use to quickly get your VISA status and continue with whatever you were doing.
27
26
 
28
27
  ```
29
- us_passport_tracker PassportNumber ISOCountryCode
28
+ uspasstracker PassportNumber ISOCountryCode
30
29
  ```
31
30
 
32
31
  **Example (Status check via Ghana Embassy)**
33
32
  ```
34
- us_passport_tracker G167290 GH
33
+ uspasstracker G167290 GH
35
34
  ```
36
35
 
37
36
  **Example (Status check via Nigeria Embassy)**
38
37
 
39
38
  ```
40
- us_passport_tracker N167290 NG
39
+ uspasstracker N167290 NG
41
40
  ```
42
41
 
43
42
  ## Interactive Mode
44
- You may enter a mode advanced mode by simply typing `us_passport_tracker` without any arguments
43
+ You may enter a mode advanced mode by simply typing `uspasstracker` without any arguments
45
44
 
46
45
  ```
47
- us_passport_tracker
46
+ uspasstracker
48
47
  ```
49
48
 
50
49
  ## Application Usage
@@ -6,15 +6,15 @@ require 'tty-spinner'
6
6
  require 'tty-font'
7
7
  require 'pastel'
8
8
 
9
- USAGE = "USAGE: us_passport_tracker PassportNumber ISOCountryCode
9
+ USAGE = "USAGE: uspasstracker PassportNumber ISOCountryCode
10
10
 
11
11
  Examples (Ghana, Nigeria, China Respectively)
12
12
  ---------------------------------------------
13
- us_passport_tracker G167290 GH
14
- us_passport_tracker N982922 NG
15
- us_passport_tracker C829293 CN
13
+ uspasstracker G167290 GH
14
+ uspasstracker N982922 NG
15
+ uspasstracker C829293 CN
16
16
 
17
- Just call [us_passport_tracker] without arguments for interactive mode".freeze
17
+ Just call [uspasstracker] without arguments for interactive mode".freeze
18
18
 
19
19
  CREDITS = "v#{USPassportTracker::VERSION} codename #{USPassportTracker::CODENAME}
20
20
  Maintained and brought to you by Alfred Rowe".freeze
@@ -38,6 +38,14 @@ def credits
38
38
  line_separator
39
39
  end
40
40
 
41
+ def status(tracker)
42
+ if tracker.ready_for_pickup?
43
+ @pastel.green(tracker.response_text)
44
+ else
45
+ @pastel.red(tracker.response_text)
46
+ end
47
+ end
48
+
41
49
  if ARGV.size == 1 && ARGV[0] == 'help'
42
50
  credits
43
51
  puts USAGE
@@ -64,4 +72,4 @@ tracker.status
64
72
  spinner.stop(@pastel.green('Done!'))
65
73
  line_separator
66
74
  puts(bold_text("Country Name: #{@pastel.green(tracker.country_name)}"))
67
- puts(bold_text("Status: #{@pastel.green(tracker.response_text)}"))
75
+ puts(bold_text("Status: #{status(tracker)}"))
@@ -49,6 +49,11 @@ module USPassportTracker
49
49
  @response_text
50
50
  end
51
51
 
52
+ def ready_for_pickup?
53
+ return false if @response_text.nil?
54
+ @response_text.include? 'ready'
55
+ end
56
+
52
57
  private
53
58
 
54
59
  def uri_country_name
@@ -1,4 +1,4 @@
1
1
  module USPassportTracker
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  CODENAME = 'IndianaJones'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: us_passport_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfred Rowe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-29 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,7 @@ description: Use this tool to check the status of your VISA & Passport collectio
113
113
  email:
114
114
  - luvlyrowe@gmail.com
115
115
  executables:
116
- - us_passport_tracker
116
+ - uspasstracker
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
@@ -128,7 +128,7 @@ files:
128
128
  - Rakefile
129
129
  - bin/console
130
130
  - bin/setup
131
- - exe/us_passport_tracker
131
+ - exe/uspasstracker
132
132
  - lib/us_passport_tracker.rb
133
133
  - lib/us_passport_tracker/version.rb
134
134
  - us_passport_tracker.gemspec