newegg_scraper_chsbr 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: 6a1b81329b2a7b6d81d367cb748a541aadf7ec20bc5e6de1cb4d3a213272d0f2
4
- data.tar.gz: f0db86150303b05d41ba55e7e7e9da56a0c5b4517d7e18e2d8f7e297cf35171d
3
+ metadata.gz: 3fbd42d7c10c468dc7425a30d88e29f8e6f268daa251709476c87e4ad071dc23
4
+ data.tar.gz: 02bd7b5230d23751a3904e2650ff50c7b0e6d761bd6f66c0d8179657963ee647
5
5
  SHA512:
6
- metadata.gz: 3f181080b9900c467cbc954c7174aee44515cdab8f7261007a3cf5a1716334d8c7e6f9d6941d4b56a47e72d3e8a7c507ae10b93e060af63fb491e5e53da13a67
7
- data.tar.gz: 0cfa7c6ef87a6af288baa2011fc8f0d9ed19669c06604cbc4dbdcd70febe493862c7f00501807e5dec9298a26411a9778be6beb14f2cd3afe9caf34504335e34
6
+ metadata.gz: 05cfd1984328242a0da29c958d612473aba871b97bb2d2b03c705a85d148c5b0d58a3b26856b7a60a12699b46d5148a4870f7d89162604ca4da205101ab699c8
7
+ data.tar.gz: 16cfc1c007ce8c374d7bf0dc8b9cd9147cb37b23c303c64a856cf17faeeb6e7f4f4495a1103ca582cbce571ceefaef6bb35b792e9ccd25afb9cc939abdefcbe0
@@ -7,12 +7,12 @@ class NeweggScraperChsbr::Cli
7
7
  puts "Were you interested in purchasing some CPU's?"
8
8
  puts "Please enter y to do so."
9
9
  @counter = gets.strip
10
- corr_input = control_bool
11
- while corr_input
10
+ incorrect_input = control_bool
11
+ while incorrect_input
12
12
  puts "Were you interested in purchasing some CPU's?"
13
13
  puts "Please enter y to do so.\nPlease enter n or exit to quit."
14
14
  @counter = gets.strip
15
- corr_input = control_bool
15
+ incorrect_input = control_bool
16
16
  end
17
17
  while @counter == 'y'
18
18
  get_price_range
@@ -28,14 +28,16 @@ class NeweggScraperChsbr::Cli
28
28
 
29
29
  puts "If you would like to restart the program please enter : #{@counter}.\nTo exit type n or exit."
30
30
  @counter = gets.strip
31
- corr_input = control_bool
32
- while corr_input
31
+ incorrect = control_bool
32
+ while incorrect
33
33
  puts "Were you interested in purchasing some CPU's?"
34
34
  puts "Please enter y to do so.\nPlease enter n or exit to quit."
35
35
  @counter = gets.strip
36
- corr_input = control_bool
36
+ incorrect = control_bool
37
37
  end
38
-
38
+ clear_vars
39
+ @user.clear_chosen
40
+ self.call
39
41
  end
40
42
  puts "Thanks for using Chesbro's Scraper!"
41
43
  end
@@ -102,30 +104,26 @@ class NeweggScraperChsbr::Cli
102
104
  end
103
105
  end
104
106
  def control_bool
105
- if @counter.include?("y")
106
- false
107
- elsif @counter.include?("exit")
107
+ if @counter == "y"
108
108
  false
109
- elsif @counter.include?("n")
109
+ elsif @counter == "exit" || @counter == "n"
110
110
  false
111
111
  else
112
112
  true
113
113
  end
114
114
  end
115
115
  def cpu_make_bool
116
- if @cpu_make.include?("x")
117
- @cpu_make = "x"
118
- false
119
- elsif @cpu_make.include?("a")
120
- @cpu_make = "a"
121
- false
122
- elsif @cpu_make.include?("i")
123
- @cpu_make = "i"
116
+ if @cpu_make == "x" || @cpu_make == "a" || @cpu_make == "i"
124
117
  false
125
118
  else
126
119
  true
127
120
  end
128
121
 
122
+ end
123
+ def clear_vars
124
+ @cpu_make = nil
125
+ @min_price = nil
126
+ @max_price = nil
129
127
  end
130
128
  # def choose_cpu(printed_cpus)
131
129
  # puts "Please enter the number of the CPU you'd like to see more about."
@@ -70,7 +70,7 @@ class NeweggScraperChsbr::DataGrabber
70
70
  end
71
71
  end
72
72
  def isCoolerOrMB?(name)
73
- name.include?("Water") || name.include?("Air") || name.include?("Motherboard") || name.include?("AIO") || name.include?("FLY") || name.include?("Cooler")
73
+ name.include?("Water") || name.include?("Air") || name.include?("Motherboard") || name.include?("AIO") || name.include?("FLY") || name.include?("Cooler") || name.include?("Block")
74
74
  end
75
75
  def getPrice
76
76
  scraped_info = NeweggScraperChsbr::Scraper.new
@@ -28,6 +28,9 @@ class NeweggScraperChsbr::User
28
28
  end
29
29
 
30
30
  end
31
+ def clear_chosen
32
+ @chosen_cpu = []
33
+ end
31
34
  def is_numeric?(obj)
32
35
  obj.match(/\A[^+-]?\d+?(\^.\d+)?\Z/) == nil ? false : true
33
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeweggScraperChsbr
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newegg_scraper_chsbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lrd134
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri