page_by_page 0.1.6 → 0.1.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
  SHA1:
3
- metadata.gz: ac89d6a7b6b45addd50b7738d2a8b90c6609b1f9
4
- data.tar.gz: 3ea2de6bddb75c604dea419092b50e1f353fc4ec
3
+ metadata.gz: b503de846c6f14e44ebb68d6da30f0647e3a9e42
4
+ data.tar.gz: 0b74d6adf88048ed8a78441ec24fad1f686c8ac7
5
5
  SHA512:
6
- metadata.gz: 7a826438ea81f09e717674bbbc955af03676303056ad576c28905bfb74eb45a935f34e3127e85c19c0e5c31d3329a9f91b8e0fbdd87fc76a65b76ffa19dd41cd
7
- data.tar.gz: 2706c0b89de6f87b454061e9372db5f5cb1885d5cd735df4d587421a6aa464576b64e948cbc1f5d22e91f3814a3d9b3935410a96d1977d6fab1becf0652aa54c
6
+ metadata.gz: 032d1274977d459339c51d44648b56ba3eb066818137866ed8c80753f0b9009bebf40a59ef614601034e56e02d466a8636cbf5af86bb9b68309da20c01ba09bd
7
+ data.tar.gz: 70f97621564edf8ccbade3a23131ca53722f5e7357382d1803ffdf5e17cb1a359e397ac2d6d32c97d8411bca1391a2bc1c51aae6e9378ae1dd508cf50d254f40
@@ -1,3 +1,3 @@
1
1
  class PageByPage
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/page_by_page.rb CHANGED
@@ -51,13 +51,13 @@ class PageByPage
51
51
  @enum = MutexEnum.new options
52
52
  parallel_fetch
53
53
  end
54
- nodes_2d.flatten
54
+ nodes_2d.reject(&:nil?).flatten
55
55
  end
56
56
 
57
57
  private
58
58
 
59
59
  def _fetch
60
- items, all_items = [nil], []
60
+ items, pages = [nil], []
61
61
  catch :no_more do
62
62
  until items.empty?
63
63
  n = @enum.next
@@ -65,10 +65,10 @@ class PageByPage
65
65
  url = @tmpl.result binding
66
66
  doc = parse url
67
67
  items = doc.css @selector
68
- all_items[n] = items
68
+ pages[n] = items
69
69
  end
70
70
  end
71
- all_items
71
+ pages
72
72
  end
73
73
 
74
74
  def parallel_fetch
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_by_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.4.8
111
+ rubygems_version: 2.6.7
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: scrape page by page , according to url pattern