bookworm_buddy 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: b8847ede82beacb22c985ab087f67fd31a21aee6
4
- data.tar.gz: 03a176eeb28cef048090bc75c3c8d61680ce577c
3
+ metadata.gz: e34ef3bfc7c100c10838e5963cf58a7d585d107d
4
+ data.tar.gz: 9c55454579c95614bcecc16cf15f8d3fba222d31
5
5
  SHA512:
6
- metadata.gz: 7bc998826fc351e1d97363babbbc64eb2de82e8f4394dbfd46ca6bcdf15a4ad550d30e7d54779165addb612c5ce8fc0c2d9b7316d18f8d0a0e18f10a07216e7e
7
- data.tar.gz: 5dfb5142f8d2fe94914772f4f527b615de1220a5bf9e8e9c009e4304598e5de76c10cf575496f78bca3f6e41023c3fdb7db03c4715b9e568eec28bbe7f4ebfbc
6
+ metadata.gz: 28bb8cea8cc0e888f40fcbe72a4925daa209340742375cbf7b55675b4de0b469ee96cc10b72b12e17bbe95d2e52e5b59e6f636c0eea36f2b631016bd7d636be3
7
+ data.tar.gz: 4005d163d4f210310c200747d27c586709ba2a170cbc8fe44a305c649a8b20574b520423bf66daf8ecf5533dcf390ab2bcd3df3734329ad91b0d5b9a8e2ebf31
@@ -1,22 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bookworm_buddy (0.1.2)
4
+ bookworm_buddy (0.1.5)
5
5
  colorize (~> 0.8.1)
6
6
  nokogiri
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- coderay (1.1.2)
12
11
  colorize (0.8.1)
13
- method_source (0.9.0)
14
12
  mini_portile2 (2.3.0)
15
13
  nokogiri (1.8.2)
16
14
  mini_portile2 (~> 2.3.0)
17
- pry (0.11.3)
18
- coderay (~> 1.1.0)
19
- method_source (~> 0.9.0)
20
15
  rake (10.5.0)
21
16
 
22
17
  PLATFORMS
@@ -25,7 +20,6 @@ PLATFORMS
25
20
  DEPENDENCIES
26
21
  bookworm_buddy!
27
22
  bundler (~> 1.16)
28
- pry
29
23
  rake (~> 10.0)
30
24
 
31
25
  BUNDLED WITH
@@ -3,4 +3,4 @@ require_relative '../lib/bookworm_buddy.rb'
3
3
 
4
4
  BookwormBuddy::CLI.new.call
5
5
 
6
-
6
+ #Namespacing
@@ -13,12 +13,7 @@ class BookwormBuddy::Book
13
13
 
14
14
  def self.list_books_by_category(category_number)
15
15
  puts BookwormBuddy::Category::ALL[category_number.to_i - 1].name.colorize(:magenta)
16
- if ALL == []
17
- puts "\n""So sorry, that category seems to be empty at the moment. Check back soon!".colorize(:red)
18
- BookwormBuddy::CLI.new.main_menu
19
- else
20
16
  ALL.each_with_index {|book, index| puts "#{index+1}. \"#{book.title}\" - by: #{book.author} - #{book.price}"}
21
- end
22
17
  end
23
18
 
24
19
  def self.list_title(book)
@@ -12,7 +12,6 @@ class BookwormBuddy::Category
12
12
  end
13
13
 
14
14
  def self.list_categories
15
- ALL.each_with_index {|category, index| puts "#{index+1}. #{category.name}"}
15
+ ALL.each.with_index(1) {|category, index| puts "#{index}. #{category.name}"}
16
16
  end
17
-
18
17
  end
@@ -46,11 +46,16 @@ class BookwormBuddy::CLI
46
46
  input = gets.strip
47
47
  if input.to_i.between?(1, 50)
48
48
  BookwormBuddy::Scraper.get_books_by_category(input)
49
+ if BookwormBuddy::Book::ALL.empty?
50
+ puts "\n""So sorry, that category seems to be empty at the moment. Please try another category!".colorize(:red)
51
+ bestsellers
52
+ else
49
53
  BookwormBuddy::Book.list_books_by_category(input)
50
54
  puts "\n""----------------------------------------".colorize(:cyan)
51
55
  puts "\n""To see the summary of a title that interests you, enter that number below. Otherwise, enter 'list' to return to the list of categories, or 'exit' to exit.".colorize(:green)
52
56
  puts "\n""----------------------------------------""\n".colorize(:cyan)
53
57
  description
58
+ end
54
59
  elsif input == "list"
55
60
  list
56
61
  elsif input == "exit"
@@ -1,3 +1,3 @@
1
1
  module BookwormBuddy
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookworm_buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristen Leach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-10 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler