uscis_status 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzU0YjVlM2MyYmIzNmI0ZTg0OWM4YWNiYzg2NjVjNjBmMWQ3MmVlYw==
4
+ ZWJiYTM4YTVmMzJhOTk1OTgwNzI1YzJhZWFiODVlMjBkYWQ0NjgwYQ==
5
5
  data.tar.gz: !binary |-
6
- Mzc2ZDlhMzEyZGEwZWM0M2RlMDhjNzc2MjdhNWY0ZmU5ZjFhZTE2ZA==
6
+ ODVjODFhNzlmMGM4MDgxMjE1MjNiZjIxOTYwMzMyYzc1ZWI0MDFiNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZThlYzQxNzFlMTZlYmNlYjkwMTdhYjQxOGE4NjUyN2I3YTZhMmQxOTExOGE4
10
- NmUzYjkxZmU3NDgwNTQyMTU0Njg5MjZhYTIzOTMzMjFmZTg0ZTY1YTdlMWE1
11
- NGQ2MGY0MzA5MzM4OTIzZGZkYTZmZTJkZWM0NWJhYWQ4ZjA2OTk=
9
+ ZWZlNjRmNjFkZGM1YzMzNjJjMGE4YmE5MDFmZDRjNmM5MWNjYjgzYWY5YjJj
10
+ ZWUxZmQwYjk2NjE0MWVkOWRkYTNlMjUwMjcwZGJjN2MzZTYyMDc5MThmZDdl
11
+ ZTk3ZDQyNzgwZTYwMzE0MTRhMWM0MTgzYjg0Njg2YTU1MTE1YjQ=
12
12
  data.tar.gz: !binary |-
13
- ZTY5NTcxNjU4YjE0YzAwMjViZWQxMTE4Nzk0NzA3YmU2MTZkOTI3MmM2ZDlj
14
- ZTY3OTJmN2Y3ZDI4ODhhMmI1NzFkNTI1OTM5MWYzODc2NjlhMjVjNTExNTNi
15
- OTkzYjFlZWZlYzQ4ZjA3MDMyYzU1Y2JmNzRmM2I5ZDI1NGEwMDA=
13
+ ZjQ2MDUxNzEwMzFiNTA1ODZiYjJmNjQ5ODE0NjAyMzdiZGI5MDVlZTBiM2I3
14
+ MThhMDQyMWI4MmY1ZDJmYTQ4MzJhYzE2YmYxZjA3MGI4OTc5YWJjYWE0N2Zk
15
+ MjcyMWNlOTUxMzc0MDY3NzM2ODk2OWRkOTU5YzU1NjI1MTNlNzA=
data/README.md CHANGED
@@ -7,6 +7,10 @@ This gem makes it easy to check multiple application statuses from USCIS website
7
7
  This is not the official way to check the status of a USCIS application and it's not endorsed by USCIS either.
8
8
  It's just a scraper of the USCIS website and it may break at any time if the website is updated. If it should happen, feel free to report me or to [fix](#contributing) the problem.
9
9
 
10
+ ## New on version 0.3.0
11
+
12
+ Now it checks if the Application is in the last status (step). If it's in the last status, the Application is complete.
13
+
10
14
  ## Live Example
11
15
 
12
16
  Take a look at the 'Multiple USCIS Status Checker' website that uses this gem:
@@ -47,7 +51,8 @@ Or install it yourself as:
47
51
  :type => "Form I485, Application To Register Permanent Residence Or To Adjust Status",
48
52
  :status => "Acceptance",
49
53
  :description => "On March 20, 2013, your fingerprint fee was accepted and we have mailed...",
50
- :general_description => "During the acceptance step USCIS reviews newly received applications and..."
54
+ :general_description => "During the acceptance step USCIS reviews newly received applications and...",
55
+ :complete => "false"
51
56
  }
52
57
 
53
58
 
@@ -22,7 +22,7 @@ module USCISStatus
22
22
  # Look for possible errors with this application number
23
23
  error = page.search('.//div[@class="errorContainer"]/ul')
24
24
  if !error.empty?
25
- statuses << {number: number, type: 'NONE', status: error.text.strip, description: '', general_description: ''}
25
+ statuses << {number: number, type: 'NONE', status: error.text.strip, description: '', general_description: '', complete: ''}
26
26
  next
27
27
  end
28
28
 
@@ -32,6 +32,10 @@ module USCISStatus
32
32
  # Get current application block
33
33
  current_application = page.search('.//div[@class="caseStatusInfo"]')
34
34
 
35
+ # Verify if it's in the final step a.k.a 'Complete'
36
+ steps = page.search('.//table[@id="buckets"]/tr/td')
37
+ complete = steps[steps.count - 1]["class"] == "current" ? "true" : "false"
38
+
35
39
  # Get the Status
36
40
  status = current_application.search('.//h4').text.strip
37
41
 
@@ -41,7 +45,7 @@ module USCISStatus
41
45
  # Get the General Description for the Application
42
46
  general_description = current_application.search('.//div[@id="bucketDesc"]').text.strip
43
47
 
44
- statuses << {number: number, type: application_type, status: status, description: description, general_description: general_description}
48
+ statuses << {number: number, type: application_type, status: status, description: description, general_description: general_description, complete: complete}
45
49
 
46
50
  end
47
51
 
@@ -1,3 +1,3 @@
1
1
  module USCISStatus
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uscis_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Guerini