rbbt-sources 3.1.41 → 3.1.42

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/sources/pubmed.rb +40 -40
  3. metadata +2 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0a35626b221e15867cb54ca9e8bbeb007762b5a99afed75d57d6b473385c287
4
- data.tar.gz: 59d067abbfdcd686f39b3604282a280ca9bf4a0e8f3284698202dae8d9d50d55
3
+ metadata.gz: d58670542b15951452edfc4607511ae6d3a4e2795bd13a1b207489c75cb869c9
4
+ data.tar.gz: b53a205a5e9b0b857a39f9a3dfa0a7da9db88c8ed3f734af9b0310320504993d
5
5
  SHA512:
6
- metadata.gz: 1c9c6a2dc5184319e94af671762227bba331b49784cf3e4ac0550b6c023c7b072920d75175b0547c2d8cb4034dbca53dda9514238773cf98f103cc6be978c4ec
7
- data.tar.gz: df52691bf65b891a906217f5e2647577bc74940bbd3fa1752115f624a313472a70a43fb96b786e30a4612bc71badb7b3e68c539e0024fe0f0958ee5f33d910af
6
+ metadata.gz: c84dfab9e1f914b0ecfaede54839ee90644f6bbb9777044ede0cc0358f18e0e78ff3e757583049e699ba6ff7700c2dfc74816998c74a78ac0a82580a042e6f29
7
+ data.tar.gz: bb649a7250d617e9fef26068ed1c7624828ff2c4a2a0e8696a621e7b6b821918d9ddcff1ccae4729c8e26a1fe79f6d9723936f85519e57b677ff405b30e3f5ea
@@ -177,46 +177,46 @@ module PubMed
177
177
  # ID specified as an argument. If +pmid+ is an array instead of a single
178
178
  # identifier it returns an hash with the Article object for each id.
179
179
  # It uses the Rbbt cache to save the articles xml.
180
- def self.get_article(pmid)
181
-
182
- if pmid.is_a? Array
183
- missing = []
184
- list = {}
185
-
186
- pmid.each{|p|
187
- filename = p.to_s + '.xml'
188
- if File.exists? FileCache.path(filename)
189
- list[p] = Article.new(Open.read(FileCache.path(filename)))
190
- else
191
- missing << p
192
- end
193
- }
194
-
195
- return list unless missing.any?
196
-
197
- articles = get_online(missing)
198
-
199
- articles.each{|p, xml|
200
- filename = p + '.xml'
201
- FileCache.add(filename,xml)
202
- list[p] = Article.new(xml)
203
- }
204
-
205
- return list
206
-
207
- else
208
- filename = pmid.to_s + '.xml'
209
-
210
- if File.exists? FileCache.path(filename)
211
- return Article.new(Open.read(FileCache.path(filename)))
212
- else
213
- xml = get_online(pmid)
214
- FileCache.add(filename,xml)
215
-
216
- return Article.new(xml)
217
- end
218
- end
219
- end
180
+ #def self.get_article(pmid)
181
+
182
+ # if pmid.is_a? Array
183
+ # missing = []
184
+ # list = {}
185
+
186
+ # pmid.each{|p|
187
+ # filename = p.to_s + '.xml'
188
+ # if File.exists? FileCache.path(filename)
189
+ # list[p] = Article.new(Open.read(FileCache.path(filename)))
190
+ # else
191
+ # missing << p
192
+ # end
193
+ # }
194
+
195
+ # return list unless missing.any?
196
+
197
+ # articles = get_online(missing)
198
+
199
+ # articles.each{|p, xml|
200
+ # filename = p + '.xml'
201
+ # FileCache.add(filename,xml)
202
+ # list[p] = Article.new(xml)
203
+ # }
204
+
205
+ # return list
206
+
207
+ # else
208
+ # filename = pmid.to_s + '.xml'
209
+
210
+ # if File.exists? FileCache.path(filename)
211
+ # return Article.new(Open.read(FileCache.path(filename)))
212
+ # else
213
+ # xml = get_online(pmid)
214
+ # FileCache.add(filename,xml)
215
+
216
+ # return Article.new(xml)
217
+ # end
218
+ # end
219
+ #end
220
220
 
221
221
  def self.get_article(pmids)
222
222
  _array = Array === pmids
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.41
4
+ version: 3.1.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2020-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: rbbt-text
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: mechanize
43
29
  requirement: !ruby/object:Gem::Requirement