compare_supermarkets 0.1.6 → 0.1.11

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: 5c911873704b3bb59ed1ba8866df3b76eeff63227c640c05398f80602d8cfa22
4
- data.tar.gz: 259cb97d739fdec121dd0925b7546f455c52c9af1d6cf8b052d2910a8797df1d
3
+ metadata.gz: c48a773028ceb80278e00db055329c74246d123b6eb9ae2e21a32aea5b9076c3
4
+ data.tar.gz: 537ff58c66eac9eb75ec0c189617b6b28d56620e35deeae2167e03d588fdd35b
5
5
  SHA512:
6
- metadata.gz: 7fd5bbbe68d7ae9ec4da649ec9239d33ad12bfdbe22e8722ced5d784adfac7540175e1dd66bdb4e0fc44dcf80fa2e634c322be9bf8b3cfb99e28dabcc1d7e2dd
7
- data.tar.gz: 47a5f40875186ad7b3974119c3d932081100ad54ec66667d2ebecce18cd7a1971ae6783389608fce636194ea33a7ee5b7e1a2a6046285d78777ddef8fae5fd1d
6
+ metadata.gz: 978864ddd1d3719c11bfaa267e4c1f692598e56c8b6429279c7acea4cca3c585d43afd95729f8fbdda22981a147b5d58f9b026c62a369a42b2593cd676e40331
7
+ data.tar.gz: 2beda91d0652237e7bab764b8c37ce4136a97e573a74c77f1c882cfb89a1fc5f33ec3733095e4112a8a396b87e14168288fdfa89a6c9135032915489b7f94444
data/bin/setup CHANGED
@@ -3,4 +3,5 @@
3
3
  set -euo pipefail
4
4
  IFS=$'\n\t'
5
5
 
6
- bundle install
6
+ bundle install
7
+ brew install --cask chromedriver #required for watir to work
@@ -0,0 +1,13 @@
1
+ require 'pry'
2
+ require 'nokogiri'
3
+ require 'watir'
4
+
5
+ #gem install selenium-webdriver - required for watir to work
6
+ #brew install --cask chromedriver - required for watir to work
7
+
8
+ require_relative '../lib/compare_supermarkets/scraper'
9
+ require_relative '../lib/compare_supermarkets/product'
10
+ require_relative '../lib/compare_supermarkets/cli'
11
+ require_relative '../lib/compare_supermarkets/version'
12
+
13
+ Watir.default_timeout = 0
@@ -113,6 +113,10 @@ class CompareSupermarkets::CLI
113
113
  puts ""
114
114
  input = gets.strip
115
115
  puts ""
116
+ choice(input)
117
+ end
118
+
119
+ def choice(input)
116
120
  if input == "1"
117
121
  choice = CompareSupermarkets::Product.all_top_10_sorted_by_price
118
122
  print_items(choice, "asc")
@@ -140,7 +144,6 @@ class CompareSupermarkets::CLI
140
144
  invalid_input
141
145
  how_to_display
142
146
  end
143
-
144
147
  end
145
148
 
146
149
  def finished
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CompareSupermarkets
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.11"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compare_supermarkets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Berger Howes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,44 +80,38 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: |
84
- Will search Woolworths and Coles online stores for prices based on an input search parameter<br>
85
- # CompareSupermarkets<br>
86
- <br>
87
- Ever wondered 'I wonder if my shampoo is cheaper at Coles or Woolworths...?' ? But can't be bothered searching both websites and comparing? Well that's what this gem does for you. Simply install and follow the prompts.
88
-
89
- ## Installation
90
-
91
- Add this line to your application's Gemfile:
92
-
93
- ```ruby
94
- gem 'compare_supermarkets'
95
- ```
96
-
97
- And then execute:
98
-
99
- $ bundle install
100
-
101
- Or install it yourself as:
102
-
103
- $ gem install compare_supermarkets
104
-
105
- ## Usage
106
-
107
- To use compare_supermarkets call $ gem 'compare_supermarkets'
108
- and follow the prompts. The more specific you are the faster the search results appear
109
- and there will be less items to compare.
110
-
111
-
112
- ## Contributing
113
-
114
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/compare_supermarkets.
115
-
116
- ## License
117
-
118
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
83
+ - !ruby/object:Gem::Dependency
84
+ name: watir
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 6.19.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 6.19.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: selenium-webdriver
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 3.142.7
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 3.142.7
111
+ description: Will search Woolworths and Coles online stores for prices based on an
112
+ input search parameter **Google Chrome Required**
119
113
  email:
120
- - howes.j.j@gmail.com
114
+ - happymelonbox@gmail.com
121
115
  executables:
122
116
  - compare_supermarkets
123
117
  extensions: []
@@ -126,6 +120,7 @@ files:
126
120
  - bin/compare_supermarkets
127
121
  - bin/console
128
122
  - bin/setup
123
+ - config/environment.rb
129
124
  - lib/compare_supermarkets.rb
130
125
  - lib/compare_supermarkets/cli.rb
131
126
  - lib/compare_supermarkets/product.rb
@@ -136,12 +131,13 @@ licenses:
136
131
  - MIT
137
132
  metadata:
138
133
  homepage_uri: http://rubygems.org/gems/compare_supermarkets
139
- source_code_uri: https://github.com/happymelonbox/ruby_portfolio_project_gem
140
- changelog_uri: https://github.com/happymelonbox/ruby_portfolio_project_gem/blob/main/CHANGELOG.md
134
+ source_code_uri: https://github.com/happymelonbox/compare_supermarkets
135
+ changelog_uri: https://github.com/happymelonbox/compare_supermarkets/blob/main/CHANGELOG.md
141
136
  post_install_message:
142
137
  rdoc_options: []
143
138
  require_paths:
144
139
  - lib
140
+ - config
145
141
  required_ruby_version: !ruby/object:Gem::Requirement
146
142
  requirements:
147
143
  - - ">="