travis-ci
68 of 68 new or added lines in 2 files covered. (100.0%)
396 of 3344 relevant lines covered (11.84%)
0.12 hits per line
1 |
module Stanford |
× |
2 |
module Importer |
× |
3 |
class PurlRetriever |
× |
4 |
def self.get(druid) |
× |
5 |
new(druid).get |
× |
6 |
end
|
× |
7 |
|
× |
8 |
def initialize(druid) |
× |
9 |
@druid = druid
|
× |
10 |
end
|
× |
11 |
|
× |
12 |
def get |
× |
13 |
conn.get(path).body |
× |
14 |
end
|
× |
15 |
|
× |
16 |
private |
× |
17 |
|
× |
18 |
def path |
× |
19 |
"/#{@druid}.xml"
|
× |
20 |
end
|
× |
21 |
|
× |
22 |
def conn |
× |
23 |
@conn ||= Faraday.new(url: 'https://purl.stanford.edu') do |faraday| |
× |
24 |
faraday.adapter :httpclient
|
× |
25 |
faraday.use Faraday::Response::RaiseError # raise exceptions on 40x, 50x responses |
× |
26 |
end
|
× |
27 |
end
|
× |
28 |
end
|
× |
29 |
end
|
× |
30 |
end
|
× |