jishan_fast_track_gem 0.1.8 → 0.1.9

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: f32226133848f91f9a4fb703fc0ba6d36c0ce139268b8ca02607843a1bbca85e
4
- data.tar.gz: 02476d1b39041fd5d32ed969220bbb25adcbc9fed76d91ff438da8642ba58a33
3
+ metadata.gz: 2f349eb979758a14bbd2408da56b80f427b81bcf8c2adedcf7233548725391d0
4
+ data.tar.gz: 36a8fd88dc5d0784ce8bf8719c10a600176aa0b1b4f5f7fd0b318b71f34236d9
5
5
  SHA512:
6
- metadata.gz: db954cb8e4a3ea37b6c55febdc105da497a836f9532713e5d3e26d46d1fe35f971eac00c844a1d79c303f3eb0dc1bdfafeeb371eac1b37545f85b26094cc5185
7
- data.tar.gz: f4eb90d5e47282dc0874dda094544f95306528e140ff2836169b34e038fec157315eb8551f44e868de83d5221e4ac2717b51a7e60f6db3d4ad46091bf829b4d9
6
+ metadata.gz: a84d153276e3ade1d34143907a40ae854d01b25eedaa2b417691a4a9367a446819b46fa35031e22312f17246951dc759252a8d4b72a3336db2aad082b83ce7bc
7
+ data.tar.gz: 56d984310f1443769e1eff6672c1860438a4f110d66a2e5558b5663db9cb7656c464a9c0afe0dd3a1746266a80fa9a93386aff11059c5ab28e57d6153d12611b
data/lib/files_check.rb CHANGED
@@ -8,20 +8,23 @@ class Provided_files_check
8
8
  end
9
9
 
10
10
  def income_proof
11
- puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:blue)
11
+ puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:light_blue)
12
+ puts "if you wish to leave this file check process, type 0 ".colorize(:green)
13
+
12
14
  url = gets.chomp
13
- return unless valid_file_check(url)
14
- return unless file_type_check(url)
15
+ return income_proof unless valid_file_check(url)
16
+ return income_proof unless file_type_check(url)
15
17
  two_forms_of_identity
16
18
  end
17
19
 
18
20
  def two_forms_of_identity
19
21
  file_arr = []
20
22
  loop do
21
- puts "provide identity documents' URL (only .pdf or .doc): ".colorize(:blue)
23
+ puts "provide identity documents' URL in total two (only .pdf or .doc): ".colorize(:light_blue)
24
+ puts "if you wish to leave this file check process, type 0 ".colorize(:green)
22
25
  url = gets.chomp
23
- return unless valid_file_check(url)
24
- return unless file_type_check(url)
26
+ return two_forms_of_identity unless valid_file_check(url)
27
+ return two_forms_of_identity unless file_type_check(url)
25
28
  file_arr << url
26
29
  break if file_arr.size == 2
27
30
  end
@@ -31,11 +34,13 @@ class Provided_files_check
31
34
 
32
35
 
33
36
  def retailer_quote
34
- puts "Provide the eligible quote URL (only .pdf or .doc): ".colorize(:blue)
37
+ puts "Provide the eligible quote URL (only .pdf or .doc): ".colorize(:light_blue)
38
+ puts "if you wish to leave this file check process, type 0 ".colorize(:green)
39
+
35
40
  url = gets.chomp
36
41
  file_type = File.extname(URI.parse(url).path)
37
- return unless valid_file_check(url)
38
- return unless file_type_check(url)
42
+ return retail quote unless valid_file_check(url)
43
+ return retail quote unless file_type_check(url)
39
44
  eligible_quote(url)
40
45
  end
41
46
 
@@ -50,29 +55,38 @@ class Provided_files_check
50
55
  end
51
56
 
52
57
  if result != nil
53
- puts "Eligible retailer."
58
+ puts "Eligible retailer.".colorize(:red)
54
59
  else
55
- puts "Not Eligible retailer. Please check the provided list of CEC approved retailers below"
60
+ puts "Not Eligible retailer. Please check the provided list of CEC approved retailers below, wish to hear back from you soon.".colorize(:light_yellow)
56
61
  tp csv.map { |row| row.to_hash }, { :NAME => { display_name: "Company Name" } }, { :URL => { width: 35 } }
57
62
  end
58
63
  end
59
64
 
60
65
  def valid_file_check(url)
66
+ loop do
61
67
  if url =~ URI::regexp
68
+ puts "It's a valid URL."
62
69
  return true
70
+ elsif url == "0"
71
+ exit
63
72
  else
64
- puts "It's not a valid file URL."
73
+ puts "It's not a valid file URL.".colorize(:light_yellow)
65
74
  return false
66
75
  end
76
+ break if url == "0" || url =~ URI::regexp
77
+ end
67
78
  end
68
79
  def file_type_check(url)
80
+ loop do
69
81
  file_type = File.extname(URI.parse(url).path)
70
82
  if file_type == ".pdf" || file_type == ".doc"
71
- puts "File upload succeeded."
83
+ puts "File upload succeeded.".colorize(:red)
72
84
  return true
73
85
  else
74
- puts "upload failed. please provide .pdf or .doc document."
86
+ puts "Upload failed, please provide .pdf or .doc document.".colorize(:light_yellow)
75
87
  return false
76
88
  end
89
+ break if file_type == ".pdf" || file_type == ".doc"
90
+ end
77
91
  end
78
92
  end
@@ -1,3 +1,3 @@
1
1
  module JishanFastTrackGem
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -8,9 +8,9 @@ require_relative 'manage_lists'
8
8
  # Help file includes *comprehensive* instructions which *accurately* describe: steps to install the application; dependencies required by the application; system/hardware requirements; features of the application.
9
9
 
10
10
  john = Solar_panel_rebate_egilibility_check.new
11
- john.ower_of_the_property
11
+ # john.ower_of_the_property
12
12
  john_files = Provided_files_check.new
13
- # john_files.income_proof
13
+ john_files.income_proof
14
14
 
15
15
  # list_zone_1 = Manage_list.new
16
16
  # list_zone_2 = Manage_list.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jishan_fast_track_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jishan_Lu