goodreads-books 0.1.2 → 0.1.3

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: 9e4b864502b272cfc85b099364e5620d33808a4a6de5da2f2fa961cd25754676
4
- data.tar.gz: b12f7f449a2701de75e55c9675a423b7b478a3c6e86318c773ba7fa549ff1865
3
+ metadata.gz: 582ea3ec63e81d29dfa97f139961d1260e9cc5da205084925c0b6bbc31b3675b
4
+ data.tar.gz: 3e99a6197c0964bdc28c7d568807142214f6c1a21f7e81740056aff9b2313374
5
5
  SHA512:
6
- metadata.gz: b9352d2861fab111920c9f8d35662412bf4babf16658df60baefcc5b7897380927c8684a4ab27b41c490c1feb351a16ca2a18fdb58b7cdcddc74d132a42aa98d
7
- data.tar.gz: 166d78168a329e0fc6aab2a61962c040464b0d74fdb2cfcc1c6f4aa5278680762861cd72bc97482ef3035b2097581f10d0cccaab5b9d6c40ae518273d48f66f1
6
+ metadata.gz: d92e2c594272e9a7ba13478d54db8ca61dd814460a82dc35e1d2dd7950556cae947f1413e78240fb15aec9e947d760b2c2b6892955c0257924a9426ffb0a2c3f
7
+ data.tar.gz: 60858dec0f6e2baa92bc93a2af0e188d52e42f74d4ef8c98d6154ec3424f07d7071880f43dbf15b5cccfb185415a2611b64d519b0990bc13bee309f23ae755a2
@@ -21,7 +21,7 @@ class GoodreadsBooks::CLI
21
21
  @awards_year = awards_year
22
22
  puts "Loading The Winners of #{awards_year} Goodreads Choice Awards Books..."
23
23
  if GoodreadsBooks::Book.find_all_by_year(awards_year).empty?
24
- books = GoodreadsBooks::Scraper.scrape_books(awards_year)
24
+ GoodreadsBooks::Scraper.scrape_books(awards_year)
25
25
  end
26
26
  end #-- load_choice_awards_books --
27
27
 
@@ -15,9 +15,8 @@ class GoodreadsBooks::Scraper
15
15
  main_url = "#{BASE_URL}#{PAGE_URL}/best-books-#{awards_year}"
16
16
  doc = Nokogiri::HTML(open(main_url))
17
17
 
18
- # Category winners page: iterate through the best book of each category
19
- books = []
20
- doc.css(".category.clearFix").each do |category|
18
+ # Category winners page: iterate through the best book of each category and collect the book information
19
+ doc.css(".category.clearFix").collect do |category|
21
20
  category_name = category.css("h4").text
22
21
  category_url = category.css("a").attr("href").text
23
22
  category_title = category.css("img").attr("alt").text
@@ -30,10 +29,8 @@ class GoodreadsBooks::Scraper
30
29
  :category_url => "#{BASE_URL}#{category_url}"
31
30
  }
32
31
 
33
- books = GoodreadsBooks::Book.new_from_web_page(book_details)
32
+ GoodreadsBooks::Book.new_from_web_page(book_details)
34
33
  end
35
-
36
- books
37
34
  end #-- self.scrape_books --
38
35
 
39
36
  def self.scrape_book_details(book)
@@ -1,3 +1,3 @@
1
1
  module GoodreadsBooks
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodreads-books
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ni Chia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-08 00:00:00.000000000 Z
11
+ date: 2018-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,8 +94,8 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: Goodreads CLI gem is a command line application that lists the yearly
98
- Goodreads Choice Awards Winning Books.
97
+ description: Goodreads CLI gem is a command line application that lists the best books
98
+ of Goodreads Choice Awards.
99
99
  email:
100
100
  - nichia@gmail.com
101
101
  executables: