coding_resources 0.2.5 → 0.2.6

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: bcacee26b2758d11c7a77cc90a02ffe61fd3e8ba5bcb1db0f46376982bf2d28c
4
- data.tar.gz: 0a43c76fef3081246e596a76c72b44a4ed99ab9bd8415d9642acfc01769e9577
3
+ metadata.gz: 38843bc4045122b6643160f8758a506910ebd182daac0daffac30e1febbc1b20
4
+ data.tar.gz: eb28f7dd2eddec91f1fa79717c83e716a55a77a24ee812c9a3953269d205fab2
5
5
  SHA512:
6
- metadata.gz: 0c4ba43330084078df8be4896c1dd6fd51705d5b50ba1624e3c88b80712f8f5c0fa83e2469cfb3d81f6105d16467281da3a59a390387af18f04fad3bd8dc15b9
7
- data.tar.gz: 9b70ff27d2983a33ed79890abeb4e4f5f27138e8a2de097144bf5e76086f72f6a521395c938e60a13de9e7249bd213afc0ec821abd2c610322505130753cee86
6
+ metadata.gz: 8068e8c86d4b13fec48d703d3f1473af066c7e39c3f040a0eaad4beb2272c70f66469e75e627e48f6eba572e7b296b59ea45f95ec097b59fecb0f1457bc1bebc
7
+ data.tar.gz: 1c2966baf5cf59e98fb28aaffa2e99cf3e19d1f7fe163b8927e0d844546305f48097a2b8ab1ad48c86d80821b23f52e557e1f38bc6b8ca22d72a65ae556f6767
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coding_resources (0.2.2)
4
+ coding_resources (0.2.6)
5
5
  nokogiri (~> 1.8.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -17,10 +17,10 @@ And then execute:
17
17
  Or install it yourself as:
18
18
 
19
19
  $ gem install coding_resources
20
+
21
+ # Usage
20
22
 
21
- ## Usage
22
-
23
- ##After installation run gem by typing "coding_resources" into the terminal, then:
23
+ ## After installation run gem by typing "coding_resources" into the terminal, then:
24
24
 
25
25
  Type 1 to list all books.
26
26
 
@@ -28,7 +28,7 @@ Type 2 to search for a book.
28
28
 
29
29
  Type 3 to exit.
30
30
 
31
- ##After listing or searching for a book:
31
+ ## After listing or searching for a book:
32
32
 
33
33
  Type 1 to get more details on a book.
34
34
 
@@ -42,7 +42,7 @@ Type 5 to search for a new book.
42
42
 
43
43
  Type 6 to exit.
44
44
 
45
- ##After getting details on a specific book:
45
+ ## After getting details on a specific book:
46
46
 
47
47
  Type 1 to go back to the list of books.
48
48
 
@@ -1,5 +1,6 @@
1
1
  require "nokogiri"
2
2
  require "open-uri"
3
+ require "pry"
3
4
 
4
5
  require_relative "coding_resources/version"
5
6
  require_relative "coding_resources/cli"
@@ -3,7 +3,8 @@ class CodingResources::Scraper
3
3
  def self.scrape_all_books
4
4
  page = 0
5
5
  books = []
6
- while page < 82
6
+ last_page = Nokogiri::HTML(open("http://www.freetechbooks.com/topics")).css(".pagination li")[-2].text.to_i + 1
7
+ while page < last_page
7
8
  page += 1
8
9
  doc = Nokogiri::HTML(open("http://www.freetechbooks.com/topics?page=#{page}"))
9
10
  doc.css(".media-body").each do |book|
@@ -1,3 +1,3 @@
1
1
  module CodingResources
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
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.5
4
+ version: 0.2.6
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-19 00:00:00.000000000 Z
11
+ date: 2018-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler