rbbt 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rbbt/sources/pubmed.rb +8 -1
  2. metadata +2 -2
@@ -76,7 +76,14 @@ module PubMed
76
76
  }
77
77
 
78
78
  return list unless missing.any?
79
- articles = get_online(missing)
79
+ chunk_size = [100, missing.length].min
80
+ chunks = (missing.length.to_f / chunk_size).ceil
81
+
82
+ articles = {}
83
+ chunks.times do |chunk|
84
+ pmids = missing[(chunk * chunk_size)..((chunk + 1) *chunk_size)]
85
+ articles.merge!(get_online(pmids))
86
+ end
80
87
 
81
88
  articles.each{|p, xml|
82
89
  filename = p + '.xml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-03 00:00:00 +01:00
12
+ date: 2010-01-05 00:00:00 +01:00
13
13
  default_executable: rbbt_config
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency