compare_supermarkets 0.1.1 → 0.1.5

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: dfb65bfbef6bc53ed2b46dcb75a2f220e2808696e283872d2107b2355990841f
4
- data.tar.gz: '08a3c207418b171c4ef45a962faec2a30eb5e27ee8e42058a0c76e611362cec8'
3
+ metadata.gz: be79dd9f242a73aea055493be6268a0dbcc606dedf4cfe9df3106a76b0f03c68
4
+ data.tar.gz: bcc72badfba9c2e8cd4ee0639c1c3044f43ba9eaea0c3b563d0d2eceab2bd3bd
5
5
  SHA512:
6
- metadata.gz: 95a927635dfba228799c2ae4c9f9bcd270a5f0cad7e3562f2cf5c9c6b0b8abffe0c74e12586dda1770a753b88fcc50a3cd7b52bdcde8f9172a2ef136adf59eda
7
- data.tar.gz: bca1f45e957152491e021d27123307dd4ad94f130ecd586ddf6b8bb1c255a59e6f96991f0404c4e2949549c8a54e41fe54a4e8208adbcb639cff755a45534534
6
+ metadata.gz: 576e362afdf6795bdb834c09b4c52c7409350b4d56e21a98b9df5ea3a2f4120f3c8d334183bdc753378075bf24ac23769ae764511c6d66f19579fe7cd731faa4
7
+ data.tar.gz: ac63b86e0c2143078c7d8789de28746fd3c9c3967118794317e310e370c8f7681760b9eaa02dcb9e70015734137e03a1945598e6a34ef6a1f329dd6b8bcc0f06
@@ -42,15 +42,15 @@ class CompareSupermarkets::CLI
42
42
  self.search_supermarkets(input)
43
43
  puts ""
44
44
  puts ""
45
- if CompareSupermarkets::Product.all_count > 10
45
+ if CompareSupermarkets::Product.count > 10
46
46
  puts ""
47
47
  puts "Ooo, jeez, seems like we have a lot of results."
48
- puts "We have #{CompareSupermarkets::Product.all_count} results for you."
48
+ puts "We have #{CompareSupermarkets::Product.count} results for you."
49
49
  puts "If you were a little more specific with your search"
50
50
  puts "term, we would have less to sort through..."
51
51
  puts ""
52
52
  change_search_term
53
- elsif CompareSupermarkets::Product.all_count == 0
53
+ elsif CompareSupermarkets::Product.count == 0
54
54
  puts ""
55
55
  puts "Ohhh man! Doesn't seem like either supermarket carry"
56
56
  puts "that product."
@@ -58,7 +58,7 @@ class CompareSupermarkets::CLI
58
58
  change_search_term
59
59
  else
60
60
  puts ""
61
- puts "Great! We have #{CompareSupermarkets::Product.all_count} items for you."
61
+ puts "Great! We have #{CompareSupermarkets::Product.count} items for you."
62
62
  puts ""
63
63
  puts ""
64
64
  puts ""
@@ -79,7 +79,7 @@ class CompareSupermarkets::CLI
79
79
  puts ""
80
80
  puts "No worries"
81
81
  puts ""
82
- if CompareSupermarkets::Product.all_count > 0
82
+ if CompareSupermarkets::Product.count > 0
83
83
  how_to_display
84
84
  else
85
85
  puts ""
@@ -26,7 +26,7 @@ class CompareSupermarkets::Product
26
26
  @all
27
27
  end
28
28
 
29
- def self.all_count
29
+ def self.count
30
30
  @@all.count
31
31
  end
32
32
 
@@ -54,7 +54,7 @@ class CompareSupermarkets::Product
54
54
  sorted = @@all.sort_by! do |s|
55
55
  price_to_sort = s.dollar_value + '.' + s.cent_value
56
56
  price_to_sort.to_f
57
- end
57
+ end
58
58
  end
59
59
 
60
60
  def self.all_top_10_sorted_by_price
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CompareSupermarkets
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compare_supermarkets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Berger Howes
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
@@ -80,23 +80,52 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: Will search Woolworths and Coles online stores for prices based on an
84
- input search parameter
83
+ description: |
84
+ Will search Woolworths and Coles online stores for prices based on an input search parameter
85
+ # CompareSupermarkets
86
+
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).
85
119
  email:
86
120
  - howes.j.j@gmail.com
87
- executables: []
121
+ executables:
122
+ - compare_supermarkets
88
123
  extensions: []
89
124
  extra_rdoc_files: []
90
125
  files:
91
- - CHANGELOG.md
92
- - Gemfile
93
- - LICENSE.txt
94
- - README.md
95
- - Rakefile
96
126
  - bin/compare_supermarkets
97
127
  - bin/console
98
128
  - bin/setup
99
- - config/environment.rb
100
129
  - lib/compare_supermarkets.rb
101
130
  - lib/compare_supermarkets/cli.rb
102
131
  - lib/compare_supermarkets/product.rb
@@ -113,7 +142,6 @@ post_install_message:
113
142
  rdoc_options: []
114
143
  require_paths:
115
144
  - lib
116
- - config
117
145
  required_ruby_version: !ruby/object:Gem::Requirement
118
146
  requirements:
119
147
  - - ">="
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2021-09-26
4
-
5
- - Initial release
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in compare_supermarkets.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Justin Berger Howes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,39 +0,0 @@
1
- # CompareSupermarkets
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/compare_supermarkets`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'compare_supermarkets'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install compare_supermarkets
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/compare_supermarkets.
36
-
37
- ## License
38
-
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- task default: %i[]
@@ -1,13 +0,0 @@
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