npr_best_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
  SHA1:
3
- metadata.gz: 1e0a3ed3e157783a48b781725010524c64ef946f
4
- data.tar.gz: 74898f89327900164ada73e08b37bcf1d1910521
3
+ metadata.gz: 7299d108f857348afe8e7ec6947905dd0f53a35c
4
+ data.tar.gz: 6ad60dc0077c208e8ae0e036f90a71a55a0f84a4
5
5
  SHA512:
6
- metadata.gz: c0621b7f9cad13ff8f3ee34e0aff1fc30eec6b8cc843791e413612130553a7ea615453c435985845f50118cc64fcca5f9f9bfcaf4e1dec0b77ca0ae079a6d74b
7
- data.tar.gz: fc1e641bfe17f04899ab5c3bf35c03bbd2af4868067ccfbd9142b8b20c48c58fd6fb23d6953dfb8bbbd8f4c85362c2192c286847d45614078e6557c30eab7c97
6
+ metadata.gz: c01e23c8675aa1257484c69d78355ad5e6a19d2703b1d29c6683274549754d88255a847f7051b548a8a2a6e3c9d52fa9b56202168e44407912dcf7382c531e34
7
+ data.tar.gz: 9493906b68392f4ec1aee6d6a7d101b5d7d7cd8d3315373c64fd6eda580ef807897c0b6eeaee250632c17bebfe4cdc4f573271d589c61747b76d308d45fcc9c3
File without changes
@@ -19,12 +19,12 @@ class NPRBestBooks::CLI
19
19
 
20
20
  def list_books
21
21
  if @list
22
- puts "#{@year}'s Science Fiction & Fantasy recommendations:"
22
+ puts "\r#{@year}'s Science Fiction & Fantasy recommendations:"
23
23
  @list = NPRBestBooks::List.science_fiction_and_fantasy
24
24
  puts "Total #{@year} NPR Science Fiction & Fantasy recommendations: #{@list.count} books"
25
25
  else
26
26
  NPRBestBooks::List.latest
27
- puts "#{@year}'s Science Fiction & Fantasy recommendations:"
27
+ puts "\r#{@year}'s Science Fiction & Fantasy recommendations:"
28
28
  @list = NPRBestBooks::List.science_fiction_and_fantasy
29
29
  puts "Total #{@year} NPR Science Fiction & Fantasy recommendations: #{@list.count} books"
30
30
  end
@@ -37,7 +37,7 @@ class NPRBestBooks::CLI
37
37
  input = ""
38
38
  while input != "exit"
39
39
  input = gets.strip.downcase
40
-
40
+
41
41
  if input.to_i >= 1 && input.to_i <= @list.count
42
42
  @current_book_id = input.to_i
43
43
  current_book_array_id = @current_book_id - 1
@@ -54,10 +54,11 @@ class NPRBestBooks::CLI
54
54
  puts "=> " + "ISBN: #{@list[current_book_array_id].isbn}, ISBN-13 #{@list[current_book_array_id].isbn13}"
55
55
  puts "=> " + "Average Amazon Customer Reviews:"
56
56
  begin
57
+ print " " + "Loading Amazon Ratings..."
57
58
  NPRBestBooks::Book.lookup_amazonreviews(@list[current_book_array_id])
58
- puts " " + "#{@list[current_book_array_id].amazonratings} (#{@list[current_book_array_id].amazonreviews} Reviews)"
59
+ puts "\r " + "#{@list[current_book_array_id].amazonratings} (#{@list[current_book_array_id].amazonreviews} Reviews)"
59
60
  rescue OpenURI::HTTPError => error
60
- puts " " + "Data currently unavailable (#{error}). Try again later."
61
+ puts "\r " + "Data currently unavailable (#{error}). Try again later."
61
62
  end
62
63
  puts "================================================================================"
63
64
  sub_menu
@@ -107,13 +108,14 @@ class NPRBestBooks::CLI
107
108
  puts "=> " + "ISBN: #{@list[current_book_array_id].isbn}, ISBN-13 #{@list[current_book_array_id].isbn13}"
108
109
  puts "=> " + "Average Amazon Customer Reviews:"
109
110
  begin
111
+ print " " + "Loading Amazon Ratings..."
110
112
  NPRBestBooks::Book.lookup_amazonreviews(@list[current_book_array_id])
111
- puts " " + "#{@list[current_book_array_id].amazonratings} (#{@list[current_book_array_id].amazonreviews} Reviews)"
113
+ puts "\r " + "#{@list[current_book_array_id].amazonratings} (#{@list[current_book_array_id].amazonreviews} Reviews)"
112
114
  rescue OpenURI::HTTPError => error
113
- puts " " + "Data currently unavailable (#{error}). Try again later."
115
+ puts "\r " + "Data currently unavailable (#{error}). Try again later."
114
116
  end
115
117
  puts "================================================================================"
116
- sub_menu
118
+ sub_menu
117
119
  else
118
120
  puts "Invalid command, please try again. Error on: '#{input}'."
119
121
  puts "'list' to show book list again, 'exit' to end program."
@@ -134,4 +136,4 @@ class NPRBestBooks::CLI
134
136
  exit
135
137
  end
136
138
 
137
- end
139
+ end
@@ -28,4 +28,4 @@ class NPRBestBooks::Scraper
28
28
  amazon_html
29
29
  end
30
30
 
31
- end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module NPRBestBooks
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.12"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: npr_best_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
  - beingy
@@ -85,9 +85,7 @@ description: A Simple CLI Gem to list NPR Book Concierge website's 2015 book rec
85
85
  email:
86
86
  - beingy@gmail.com
87
87
  executables:
88
- - console
89
- - npr_best_books
90
- - setup
88
+ - npr-best-books
91
89
  extensions: []
92
90
  extra_rdoc_files: []
93
91
  files:
@@ -103,9 +101,7 @@ files:
103
101
  - bin/console
104
102
  - bin/npr_best_books
105
103
  - bin/setup
106
- - exe/console
107
- - exe/npr_best_books
108
- - exe/setup
104
+ - exe/npr-best-books
109
105
  - lib/npr_best_books.rb
110
106
  - lib/npr_best_books/book.rb
111
107
  - lib/npr_best_books/cli.rb
data/exe/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "npr_best_books"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/exe/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here