coding_resources 0.2.6 → 0.2.7

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: 38843bc4045122b6643160f8758a506910ebd182daac0daffac30e1febbc1b20
4
- data.tar.gz: eb28f7dd2eddec91f1fa79717c83e716a55a77a24ee812c9a3953269d205fab2
3
+ metadata.gz: a4d22b6e9fa89bf507f9f3ea4fcb36829e54247bbde836f9680a2097647b3a71
4
+ data.tar.gz: 1a8fa157faf81d6734b600edfaaabe34de0df1e541e9c0c121b5c4ede357e6d8
5
5
  SHA512:
6
- metadata.gz: 8068e8c86d4b13fec48d703d3f1473af066c7e39c3f040a0eaad4beb2272c70f66469e75e627e48f6eba572e7b296b59ea45f95ec097b59fecb0f1457bc1bebc
7
- data.tar.gz: 1c2966baf5cf59e98fb28aaffa2e99cf3e19d1f7fe163b8927e0d844546305f48097a2b8ab1ad48c86d80821b23f52e557e1f38bc6b8ca22d72a65ae556f6767
6
+ metadata.gz: a38d015a4a29c1d086dd4e57a3d2f49de269d51ec8c302f6a0c3384bcaff27c6c5fc44655c3c791e642107682f0d2a04576b775ae31d9f1c9d79ac6d99c61e95
7
+ data.tar.gz: 465ebc9b1282ada8e5744332632b2bfdd69586a4470c9c7ccf2276c0cd0751d332268e1655b4bf4cd55339ca1c4c2b86f74c98f19fadcdd14a23ebd4cb6d65ab
@@ -57,7 +57,6 @@ class CodingResources::Books
57
57
  def self.create_all_books
58
58
  book_array = CodingResources::Scraper.scrape_all_books
59
59
  self.create_from_collection(book_array)
60
- self.create_pages("all_books")
61
60
  end
62
61
 
63
62
  def self.search(name)
@@ -65,7 +64,6 @@ class CodingResources::Books
65
64
  self.all.each do |book|
66
65
  @@searched_books << book if book.name.downcase.split(":").join.split(",").join.split.include?(name)
67
66
  end
68
- self.create_pages("search")
69
67
  end
70
68
 
71
69
  def self.list(page)
@@ -3,12 +3,13 @@ class CodingResources::CLI
3
3
  @@page = 0
4
4
 
5
5
  def run
6
+ puts "Welcome to Coding Resources"
7
+ puts "Retrieving books..."
8
+ CodingResources::Books.create_all_books
6
9
  menu
7
10
  end
8
11
 
9
12
  def menu
10
- CodingResources::Books.create_all_books
11
- puts "Welcome to Coding Resources"
12
13
  puts "Please select an option"
13
14
  puts "1. List all books."
14
15
  puts "2. Search for a book."
@@ -18,6 +19,7 @@ class CodingResources::CLI
18
19
  if input > 0
19
20
  case input
20
21
  when 1
22
+ CodingResources::Books.create_pages("all_books")
21
23
  list
22
24
  when 2
23
25
  search
@@ -44,7 +46,8 @@ class CodingResources::CLI
44
46
  puts "3. Go back one page."
45
47
  puts "4. Go to a specific page."
46
48
  puts "5. Search for a book."
47
- puts "6. Exit"
49
+ puts "6. Go back to the main menu"
50
+ puts "7. Exit"
48
51
  puts ""
49
52
 
50
53
  input = gets.strip.to_i
@@ -65,6 +68,9 @@ class CodingResources::CLI
65
68
  search
66
69
  break
67
70
  when 6
71
+ menu
72
+ break
73
+ when 7
68
74
  exit
69
75
  when input > 6 || input < 1
70
76
  puts "That was an invalid entry."
@@ -83,6 +89,7 @@ class CodingResources::CLI
83
89
  puts "Please enter the name or part of the name of the book you are searching for."
84
90
  input = gets.strip.downcase
85
91
  CodingResources::Books.search(input)
92
+ CodingResources::Books.create_pages("search")
86
93
  @@page = 0
87
94
  list
88
95
  end
@@ -1,3 +1,3 @@
1
1
  module CodingResources
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coding_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Christopher Jones'"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-27 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler