jishan_fast_track_gem 0.1.20 → 0.1.21

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: b268595427b6c4f5b1eb772877b93538dca53d4b090c4522723294bb2af5396d
4
- data.tar.gz: 90b572eecefb39d4e0b6a701b9e61b38efb3ada82836c0e61b9ed4582b367cdc
3
+ metadata.gz: cf3582d67afde6b674cdd0ceba08adcaec85dbb2c2d37349b47750f1cc55a4a8
4
+ data.tar.gz: fe2335934cfe488ab95e5c4c3a88a8c99878f468b85a5640ef10d03254272654
5
5
  SHA512:
6
- metadata.gz: b456511eed51a72b751308ab22956f45ffff05542fe51707ac2866d17414c6bf994299540c6b2dea2116e936e6785ebbabaf47b979a6ed16d51bbc966abc2696
7
- data.tar.gz: 6566940d1f5f737bc0941a988d2adb88cad7f0879a7c2bc78594b903bd60a14a3dcd9fd473707013210fb334b9ccd771a730ed63a9d460e5ef618b768bef14f4
6
+ metadata.gz: cd292eff028c3357e27fbfbc9325596d647d029f50553288634a7cb0a1dfb7124a45f5b79936621fc7ecf07d44be64876403f7ce2bebaef189639bfc1f6400aa
7
+ data.tar.gz: 4343a956c9f34c4a7371f4af8e80799fcc8e61d048056dbf85c19f30864fbc9d4472277df34bcd50b76eec318a70d21678b03912ba9ef31b817deaee5302ba77
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jishan_fast_track_gem (0.1.4)
4
+ jishan_fast_track_gem (0.1.20)
5
5
  colorize (~> 0.8.1)
6
6
 
7
7
  GEM
@@ -9,17 +9,7 @@ GEM
9
9
  specs:
10
10
  colorize (0.8.1)
11
11
  diff-lcs (1.3)
12
- equatable (0.6.1)
13
12
  gemoji (3.0.1)
14
- highline (2.0.3)
15
- necromancer (0.5.1)
16
- options (2.3.2)
17
- pastel (0.7.3)
18
- equatable (~> 0.6)
19
- tty-color (~> 0.5)
20
- progress_bar (1.3.1)
21
- highline (>= 1.6, < 3)
22
- options (~> 2.3.0)
23
13
  rake (12.3.3)
24
14
  rspec (3.0.0)
25
15
  rspec-core (~> 3.0.0)
@@ -34,18 +24,6 @@ GEM
34
24
  rspec-support (~> 3.0.0)
35
25
  rspec-support (3.0.4)
36
26
  table_print (1.5.6)
37
- tty-color (0.5.1)
38
- tty-cursor (0.7.1)
39
- tty-prompt (0.21.0)
40
- necromancer (~> 0.5.0)
41
- pastel (~> 0.7.0)
42
- tty-reader (~> 0.7.0)
43
- tty-reader (0.7.0)
44
- tty-cursor (~> 0.7)
45
- tty-screen (~> 0.7)
46
- wisper (~> 2.0.0)
47
- tty-screen (0.7.1)
48
- wisper (2.0.1)
49
27
 
50
28
  PLATFORMS
51
29
  ruby
@@ -54,11 +32,9 @@ DEPENDENCIES
54
32
  colorize (~> 0.8.1)
55
33
  gemoji
56
34
  jishan_fast_track_gem!
57
- progress_bar
58
35
  rake (~> 12.0)
59
36
  rspec (~> 3.0.0)
60
37
  table_print
61
- tty-prompt
62
38
 
63
39
  BUNDLED WITH
64
40
  2.1.4
data/bin/bundle CHANGED
@@ -24,7 +24,6 @@ m = Module.new do
24
24
  def cli_arg_version
25
25
  return unless invoked_as_script? # don't want to hijack other binstubs
26
26
  return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
-
28
27
  bundler_version = nil
29
28
  update_index = nil
30
29
  ARGV.each_with_index do |a, i|
@@ -32,7 +31,6 @@ m = Module.new do
32
31
  bundler_version = a
33
32
  end
34
33
  next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
35
-
36
34
  bundler_version = $1
37
35
  update_index = i
38
36
  end
@@ -57,17 +55,15 @@ m = Module.new do
57
55
 
58
56
  def lockfile_version
59
57
  return unless File.file?(lockfile)
60
-
61
58
  lockfile_contents = File.read(lockfile)
62
59
  return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
63
-
64
60
  Regexp.last_match(1)
65
61
  end
66
62
 
67
63
  def bundler_version
68
64
  @bundler_version ||=
69
65
  env_var_version || cli_arg_version ||
70
- lockfile_version
66
+ lockfile_version
71
67
  end
72
68
 
73
69
  def bundler_requirement
@@ -95,12 +91,10 @@ m = Module.new do
95
91
  gem "bundler", bundler_requirement
96
92
  end
97
93
  return if gem_error.nil?
98
-
99
94
  require_error = activation_error_handling do
100
95
  require "bundler/version"
101
96
  end
102
97
  return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
103
-
104
98
  warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
105
99
  exit 42
106
100
  end
data/bin/gemoji CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  require "pathname"
12
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
15
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  require "pathname"
12
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
15
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
data/bin/ldiff CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  require "pathname"
12
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
15
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
data/bin/rake CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  require "pathname"
12
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
15
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
data/bin/rspec CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  require "pathname"
12
12
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
15
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
@@ -1,29 +1,35 @@
1
- require 'uri'
2
- require 'csv'
3
- require 'colorize'
4
- require 'gemoji'
1
+ require "uri"
2
+ require "csv"
3
+ require "colorize"
4
+ require "gemoji"
5
5
 
6
6
  class EligibilityCheck
7
7
  def initialize(name)
8
8
  @name = name
9
- @answers = []
9
+ @no_arr = []
10
10
  end
11
11
 
12
+ def start_process
13
+ instruction
14
+ owner_of_the_property
15
+ received_solar_rebate_before
16
+ existed_solar_panel
17
+ combined_houshold_income
18
+ property_value
19
+ eligibility_response
20
+ end
21
+
22
+ private
12
23
  def instruction
13
24
  puts "Hello, this is a solar panel rebate eligibility check process, please follow the questions and them with a valid input 1 is yes and 2 is no. Simply type 1 or 2 will be sufficient. Although you respond with any other inputs, this program will guide you through the whole process. if you wish to leave the process type 3 as your response.".colorize(:blue)
14
25
  puts "---" * 20
15
- ower_of_the_property
16
26
  end
17
27
 
18
- private
19
-
20
- def ower_of_the_property
28
+ def owner_of_the_property
21
29
  puts "Are you the property owner and the current occupier?".colorize(:light_blue)
22
30
  user_input_options
23
31
  answer = gets.chomp.to_i
24
- return ower_of_the_property unless answer_check(answer)
25
-
26
- received_solar_rebate_before
32
+ return owner_of_the_property unless answer_check(answer)
27
33
  end
28
34
 
29
35
  def received_solar_rebate_before
@@ -31,18 +37,13 @@ class EligibilityCheck
31
37
  user_input_options
32
38
  answer = gets.chomp.to_i
33
39
  return received_solar_rebate_before unless answer_check(answer)
34
-
35
- existed_solar_panel
36
40
  end
37
41
 
38
42
  def existed_solar_panel
39
43
  puts "Is this your first solar panel installation?".colorize(:light_blue)
40
44
  user_input_options
41
-
42
45
  answer = gets.chomp.to_i
43
46
  return existed_solar_panel unless answer_check(answer)
44
-
45
- combined_houshold_income
46
47
  end
47
48
 
48
49
  def combined_houshold_income
@@ -50,21 +51,17 @@ class EligibilityCheck
50
51
  user_input_options
51
52
  answer = gets.chomp.to_i
52
53
  return combined_houshold_income unless answer_check(answer)
53
-
54
- property_value
55
54
  end
56
55
 
57
56
  def property_value
58
- puts "Is your property value less than $3 millions?" .colorize(:light_blue)
57
+ puts "Is your property value less than $3 millions?".colorize(:light_blue)
59
58
  user_input_options
60
59
  answer = gets.chomp.to_i
61
60
  return property_value unless answer_check(answer)
62
-
63
- eligibility_response
64
61
  end
65
62
 
66
63
  def eligibility_response
67
- if @answers.size == 0
64
+ if @no_arr.size == 0
68
65
  clap = Emoji.find_by_alias("clap").raw + " "
69
66
  puts "Congrats! You are eligible for solar panel rebate #{clap * 3}".colorize(:red)
70
67
  else
@@ -73,7 +70,6 @@ class EligibilityCheck
73
70
  end
74
71
 
75
72
  def answer_check(answer)
76
- while answer != 1 || answer != 2
77
73
  if answer == 1
78
74
  puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:light_yellow)
79
75
  puts " "
@@ -81,7 +77,7 @@ class EligibilityCheck
81
77
  elsif answer == 2
82
78
  puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:light_yellow)
83
79
  puts " "
84
- @answers << answer
80
+ @no_arr << answer
85
81
  return true
86
82
  elsif answer == 3
87
83
  exit
@@ -89,8 +85,7 @@ class EligibilityCheck
89
85
  puts "It is no a valid input. Please type 1. yes or 2. no."
90
86
  puts " "
91
87
  return false
92
- end
93
- end
88
+ end
94
89
  end
95
90
 
96
91
  def user_input_options
@@ -5,28 +5,31 @@ require "table_print"
5
5
 
6
6
  class FilesCheck
7
7
  attr_reader :file_list
8
+
8
9
  def initialize(name)
9
10
  @name = name
10
11
  @file_list = []
11
12
  end
12
13
 
13
- def instruction
14
- puts "Hello, this is a files check process. It will check whether your URL is valid or not first. If it is valid, it will further check whether is a supported file type. The supported file types for this process are .pdf and .doc. Although you provide unsupported files or not valid file, it will ask you to provide the valid and supported file types document again. If you wish to leave the process, simply type 3 to respond.".colorize(:blue)
15
- puts "--" * 30
14
+ def start_process
15
+ instruction
16
16
  income_proof
17
+ two_forms_of_identity
18
+ retailer_quote
17
19
  end
18
20
 
19
21
  private
22
+ def instruction
23
+ puts "Hello, this is a files check process. It will check whether your URL is valid or not first. If it is valid, it will further check whether is a supported file type. The supported file types for this process are .pdf and .doc. Although you provide unsupported files or not valid file, it will ask you to provide the valid and supported file types document again. If you wish to leave the process, simply type 3 to respond.".colorize(:blue)
24
+ puts "--" * 30
25
+ end
20
26
 
21
27
  def income_proof
22
28
  puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:light_blue)
23
29
  leave_request
24
-
25
30
  url = gets.chomp
26
31
  return income_proof unless valid_file_check(url)
27
32
  return income_proof unless file_type_check(url)
28
-
29
- two_forms_of_identity
30
33
  end
31
34
 
32
35
  def two_forms_of_identity
@@ -34,26 +37,21 @@ class FilesCheck
34
37
  loop do
35
38
  puts "provide identity documents' URL in total two (only .pdf or .doc): ".colorize(:light_blue)
36
39
  leave_request
37
-
38
40
  url = gets.chomp
39
41
  return two_forms_of_identity unless valid_file_check(url)
40
42
  return two_forms_of_identity unless file_type_check(url)
41
-
42
43
  file_arr << url
43
44
  break if file_arr.size == 2
44
45
  end
45
- retailer_quote
46
46
  end
47
47
 
48
48
  def retailer_quote
49
49
  puts "Provide the eligible quote URL (only .pdf or .doc): ".colorize(:light_blue)
50
50
  leave_request
51
-
52
51
  url = gets.chomp
53
52
  file_type = File.extname(URI.parse(url).path)
54
53
  return retail quote unless valid_file_check(url)
55
54
  return retail quote unless file_type_check(url)
56
-
57
55
  eligible_quote(url)
58
56
  end
59
57
 
@@ -78,7 +76,7 @@ class FilesCheck
78
76
  def valid_file_check(url)
79
77
  loop do
80
78
  if url =~ URI::regexp
81
- puts "It's a valid URL."
79
+ puts "It's a valid URL.".colorize(:red)
82
80
  return true
83
81
  elsif url == "3"
84
82
  exit
@@ -4,9 +4,15 @@ require_relative 'eligibility_check'
4
4
  require_relative 'manage_list'
5
5
 
6
6
  john = EligibilityCheck.new("John")
7
- john.instruction
7
+ john.start_process
8
+
8
9
  john_files = FilesCheck.new("John Files")
9
- john_files.instruction
10
+ john_files.start_process
11
+
12
+ john_rebate = RebateCalculator.new
13
+ john_rebate.start_process
14
+
15
+
10
16
 
11
17
  list_zone_1 = ManageList.new("zone 1")
12
18
  list_zone_2 = ManageList.new("zone 2")
@@ -14,14 +20,10 @@ list_zone_2 = ManageList.new("zone 2")
14
20
  list_zone_1.add_applicant("John")
15
21
  list_zone_1.add_applicant("Sab")
16
22
 
17
- list_zone_2.add_applicant("Peppy")
23
+ list_zone_2.add_applicant("Peta")
18
24
  list_zone_2.add_applicant("sup")
19
- list_zone_2.remove_applicant("Peppy")
25
+ list_zone_2.remove_applicant("Peta")
20
26
 
21
27
  p list_zone_1.list_detail
22
28
  p list_zone_2.list_detail
23
-
24
- p ManageList.display_processing_number
25
-
26
- john_rebate = RebateCalculator.new
27
- john_rebate.instruction
29
+ p ManageList.display_processing_number
@@ -1,3 +1,3 @@
1
1
  module JishanFastTrackGem
2
- VERSION = "0.1.20"
2
+ VERSION = "0.1.21"
3
3
  end
@@ -10,12 +10,18 @@ class RebateCalculator
10
10
  @stc = 0
11
11
  end
12
12
 
13
- def instruction
14
- puts "Hello, this is a rebate calculator. If you don't have the following information with you, this calculator can not evaluate the accurate rebate amount for you. The required information is the postcode, kilowatt and solar panel lifetime. Note. if your response is not in numbers, the rebate amount will always be zero. Also please make sure the provided postcode is accurate. Thank you.".colorize(:light_blue)
13
+ def start_process
14
+ instruction
15
15
  ask_parameters
16
+ stc_postcode_rating
17
+ stc_calculator
18
+ rebate
16
19
  end
17
20
 
18
21
  private
22
+ def instruction
23
+ puts "Hello, this is a rebate calculator. If you don't have the following information with you, this calculator can not evaluate the accurate rebate amount for you. The required information is the postcode, kilowatt and solar panel lifetime. Note. if your response is not in numbers, the rebate amount will always be zero. Also please make sure the provided postcode is accurate. Thank you.".colorize(:light_blue)
24
+ end
19
25
 
20
26
  def ask_parameters
21
27
  loop do
@@ -36,11 +42,8 @@ class RebateCalculator
36
42
  puts "What is the lifetime of your future solar panel?"
37
43
  deeming_year = gets.chomp.to_i
38
44
  @deeming_year = deeming_year
39
- stc_postcode_rating
40
45
  end
41
46
 
42
- private
43
-
44
47
  def stc_postcode_rating
45
48
  csv_text = File.read(__dir__ + '/stc_rating.csv')
46
49
  csv = CSV.parse(csv_text, headers: true)
@@ -49,12 +52,10 @@ class RebateCalculator
49
52
  @postcode >= stc_table['Postcode from'].to_i && @postcode <= stc_table['Postcode to'].to_i
50
53
  end
51
54
  @stc_rating = result['Rating'].to_f
52
- stc_calculator
53
55
  end
54
56
 
55
57
  def stc_calculator
56
58
  @stc = (@kw * @stc_rating * @deeming_year).floor
57
- rebate
58
59
  end
59
60
 
60
61
  def rebate
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jishan_fast_track_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jishan_Lu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-12 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -34,9 +34,11 @@ files:
34
34
  - ".gitignore"
35
35
  - ".rspec"
36
36
  - CODE_OF_CONDUCT.md
37
+ - Calculating STCs _ Solazone Australia.pdf
37
38
  - Gemfile
38
39
  - Gemfile.lock
39
40
  - LICENSE.txt
41
+ - Postcode zone ratings and postcode zones for solar panel systems.pdf
40
42
  - README.md
41
43
  - Rakefile
42
44
  - bin/bundle