stelling_banjos 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/stelling_banjos/banjos.rb +1 -1
- data/lib/stelling_banjos/cli.rb +12 -12
- data/lib/stelling_banjos/scraper.rb +3 -3
- data/lib/stelling_banjos/version.rb +1 -1
- data/stelling_banjos-1.0.0.gem +0 -0
- metadata +3 -3
- data/banjo_deals-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82d0087d7cdaf23b08bc1b02f628da848d5d2e24d98aa246e739bd6d5f60f4f5
|
4
|
+
data.tar.gz: 7c6fd21f7591def299593c3edb6cc6d8f6a9871ab6b0296a450ac3cbd47088fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4898c1de89c9693b2fc18d5b5bc7c8d62f85d62ee42d2485262662df4280aade05087ee021c8739c471e4174f10ed5c11d1fd6f98a184421eeb18ae249c34547
|
7
|
+
data.tar.gz: 93624c393e7082f8eb335542a4766c2caf04d43cadef43fc41225840941592ba72b92b19cca31be565e40398a00560a1e8fb49f6980cf32a6c3c1e704c6c799c
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# StellingBanjos
|
2
2
|
|
3
3
|
The StellingBanjos gem provides the user with a list of Stelling Banjos (the best banjos) for sale
|
4
|
-
from the website https://www.elderly.com using a CLI. The
|
4
|
+
from the website https://www.elderly.com using a CLI. The catalog displays each banjo name, the price,
|
5
5
|
and whether or not it is in stock.
|
6
6
|
|
7
7
|
The user can then make a specific banjo selection to view more information about a banjo and can follow
|
@@ -25,7 +25,7 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
|
28
|
-
|
28
|
+
Start the CLI by entering "banjo" into the terminal.
|
29
29
|
|
30
30
|
## Development
|
31
31
|
|
data/lib/stelling_banjos/cli.rb
CHANGED
@@ -12,7 +12,7 @@ class StellingBanjos::Cli
|
|
12
12
|
puts " ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚════╝ ╚═════╝ ╚══════╝╚═╝".colorize(:green)
|
13
13
|
puts " ██████████████████████████████████████████████████████".colorize(:green)
|
14
14
|
puts ""
|
15
|
-
puts " Hello! Welcome to the Stelling Banjos
|
15
|
+
puts " Hello! Welcome to the Stelling Banjos catalog! The best banjos in the world!"
|
16
16
|
first_menu
|
17
17
|
end
|
18
18
|
|
@@ -20,7 +20,7 @@ class StellingBanjos::Cli
|
|
20
20
|
puts ""
|
21
21
|
puts " MENU"
|
22
22
|
puts " ══════════════════════════════════"
|
23
|
-
puts " -Press 'Enter' to view the
|
23
|
+
puts " -Press 'Enter' to view the catalog".colorize(:green)
|
24
24
|
puts " -Type 'Exit' to leave".colorize(:red)
|
25
25
|
puts " ══════════════════════════════════"
|
26
26
|
|
@@ -40,18 +40,18 @@ class StellingBanjos::Cli
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def create_banjos
|
43
|
-
StellingBanjos::Scraper.
|
44
|
-
StellingBanjos::Banjos.
|
43
|
+
StellingBanjos::Scraper.scrape_catalog_page(LINK)
|
44
|
+
StellingBanjos::Banjos.create_from_catalog(StellingBanjos::Scraper.all)
|
45
45
|
end
|
46
46
|
|
47
47
|
def display_banjos
|
48
48
|
puts ""
|
49
|
-
puts " ██████╗ █████╗
|
50
|
-
puts "
|
51
|
-
puts " ██║ ███████║ ██║
|
52
|
-
puts " ██║ ██╔══██║ ██║
|
53
|
-
puts " ╚██████╗██║ ██║ ██║
|
54
|
-
puts " ╚═════╝╚═╝ ╚═╝ ╚═╝
|
49
|
+
puts " ██████╗ █████╗ ████████╗ █████╗ ██╗ ██████╗ ██████╗ ".colorize(:green)
|
50
|
+
puts " ██╔════╝██╔══██╗╚══██╔══╝██╔══██╗██║ ██╔═══██╗██╔════╝ ".colorize(:green)
|
51
|
+
puts " ██║ ███████║ ██║ ███████║██║ ██║ ██║██║ ███╗".colorize(:green)
|
52
|
+
puts " ██║ ██╔══██║ ██║ ██╔══██║██║ ██║ ██║██║ ██║".colorize(:green)
|
53
|
+
puts " ╚██████╗██║ ██║ ██║ ██║ ██║███████╗╚██████╔╝╚██████╔╝".colorize(:green)
|
54
|
+
puts " ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ".colorize(:green)
|
55
55
|
puts " ███████████████████████████████████████████████████████████".colorize(:green)
|
56
56
|
puts " ~ Supplied by www.elderly.com ~".colorize(:red)
|
57
57
|
puts ""
|
@@ -118,7 +118,7 @@ class StellingBanjos::Cli
|
|
118
118
|
puts " MENU"
|
119
119
|
puts " ══════════════════════════════════════════"
|
120
120
|
puts " -Enter another banjo number".colorize(:green)
|
121
|
-
puts " -Type '
|
121
|
+
puts " -Type 'Catalog' to view the catalog again".colorize(:green)
|
122
122
|
puts " -Type 'Exit' to exit".colorize(:red)
|
123
123
|
puts " ══════════════════════════════════════════"
|
124
124
|
puts ""
|
@@ -129,7 +129,7 @@ class StellingBanjos::Cli
|
|
129
129
|
elsif input.to_i.between?(1, StellingBanjos::Banjos.all.length)
|
130
130
|
puts " Loading...".colorize(:red)
|
131
131
|
info_page_display(input)
|
132
|
-
elsif input.downcase == "
|
132
|
+
elsif input.downcase == "catalog"
|
133
133
|
display_banjos
|
134
134
|
else
|
135
135
|
puts ""
|
@@ -2,9 +2,9 @@ class StellingBanjos::Scraper
|
|
2
2
|
|
3
3
|
@@all = []
|
4
4
|
|
5
|
-
def self.
|
6
|
-
|
7
|
-
|
5
|
+
def self.scrape_catalog_page(link)
|
6
|
+
catalog = Nokogiri::HTML(open(link))
|
7
|
+
catalog.css("div.ProductItem").each do |banjo|
|
8
8
|
name = banjo.css("h2").text.strip
|
9
9
|
if banjo.css("span").text.strip.include?("Sold out")
|
10
10
|
sold_out = "Yes"
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stelling_banjos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Riley Slayden'"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,6 @@ files:
|
|
81
81
|
- LICENSE.txt
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
|
-
- banjo_deals-0.1.0.gem
|
85
84
|
- bin/banjo
|
86
85
|
- bin/console
|
87
86
|
- bin/setup
|
@@ -91,6 +90,7 @@ files:
|
|
91
90
|
- lib/stelling_banjos/scraper.rb
|
92
91
|
- lib/stelling_banjos/version.rb
|
93
92
|
- stelling_banjos-0.1.0.gem
|
93
|
+
- stelling_banjos-1.0.0.gem
|
94
94
|
- stelling_banjos.gemspec
|
95
95
|
homepage: https://github.com/slaydenriley/stelling_banjos
|
96
96
|
licenses:
|
data/banjo_deals-0.1.0.gem
DELETED
Binary file
|