ct_gov 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ct_gov-0.0.2.gem +0 -0
- data/ct_gov.gemspec +2 -2
- data/lib/ct_gov.rb +4 -1
- data/lib/ct_gov/clinical_trial.rb +6 -2
- data/lib/ct_gov/version.rb +1 -1
- data/rspec/ct_gov/clinical_trial_spec.rb +6 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c93b88131f5a4ac20be43a1111e41fa3140c6d1b
|
4
|
+
data.tar.gz: 3cb7e486b1cbf27a196fb2f749abdf7ab8a99dc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56758404722c96db1ae0a6a2f870c60f0ee39f7741518be241884c566c3a7ddaa52f264f20ecf8a5ba7394b735f304368b9bfb43bd6cabbc7fb3be7ad02e47b3
|
7
|
+
data.tar.gz: 00e6d2825da736197a65afe22384451975698624702d1a6f894e20fc8988c824d1e8f130f4b41f153f90ea6701475cb832c032c7a386cfcfc366211fe259e87d
|
data/ct_gov-0.0.2.gem
ADDED
Binary file
|
data/ct_gov.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["daniel.carpenter01@gmail.com"]
|
11
11
|
spec.summary = %q{A ruby client for the ClinicalTrials.gov api.}
|
12
12
|
spec.description = %q{A ruby client for the ClinicalTrials.gov api.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/carp47/ct_gov"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "saxerator"
|
21
|
+
spec.add_runtime_dependency "saxerator", "~> 0.9.5"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
end
|
data/lib/ct_gov.rb
CHANGED
@@ -8,6 +8,9 @@ require 'ct_gov/location'
|
|
8
8
|
require 'ct_gov/publication'
|
9
9
|
|
10
10
|
require 'saxerator'
|
11
|
+
require 'uri'
|
12
|
+
require 'openssl'
|
13
|
+
require 'net/http'
|
11
14
|
|
12
15
|
module CtGov
|
13
16
|
|
@@ -23,7 +26,7 @@ module CtGov
|
|
23
26
|
request = Net::HTTP::Get.new(uri.request_uri)
|
24
27
|
response = http.request(request)
|
25
28
|
|
26
|
-
ClinicalTrial.new(Saxerator.parser(response.body)) if response.code == "200"
|
29
|
+
ClinicalTrial.new(Saxerator.parser(response.body).for_tag(:clinical_study).first) if response.code == "200"
|
27
30
|
end
|
28
31
|
|
29
32
|
end
|
@@ -87,8 +87,12 @@ module CtGov
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def publications
|
90
|
-
@raw_trial['reference'].
|
91
|
-
|
90
|
+
if @raw_trial['reference'].nil?
|
91
|
+
[]
|
92
|
+
else
|
93
|
+
[@raw_trial['reference']].flatten.map do |reference|
|
94
|
+
Publication.new(reference)
|
95
|
+
end
|
92
96
|
end
|
93
97
|
end
|
94
98
|
|
data/lib/ct_gov/version.rb
CHANGED
@@ -203,6 +203,12 @@ describe CtGov::ClinicalTrial do
|
|
203
203
|
it { expect(subject.count).to eq 3 }
|
204
204
|
|
205
205
|
it { expect(subject.first.pmid).to eq '7762914' }
|
206
|
+
|
207
|
+
context 'when there are no publications' do
|
208
|
+
before { raw_trial.delete('reference') }
|
209
|
+
|
210
|
+
it { expect(subject).to eq [] }
|
211
|
+
end
|
206
212
|
end
|
207
213
|
|
208
214
|
describe '#start_date' do
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ct_gov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Carpenter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: saxerator
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.9.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.9.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- README.md
|
66
66
|
- Rakefile
|
67
67
|
- ct_gov-0.0.1.gem
|
68
|
+
- ct_gov-0.0.2.gem
|
68
69
|
- ct_gov.gemspec
|
69
70
|
- lib/ct_gov.rb
|
70
71
|
- lib/ct_gov/address.rb
|
@@ -85,7 +86,7 @@ files:
|
|
85
86
|
- rspec/ct_gov_spec.rb
|
86
87
|
- rspec/data/sample_trial.xml
|
87
88
|
- rspec/spec_helper.rb
|
88
|
-
homepage:
|
89
|
+
homepage: https://github.com/carp47/ct_gov
|
89
90
|
licenses:
|
90
91
|
- MIT
|
91
92
|
metadata: {}
|