travis-ci
530 of 2987 relevant lines covered (17.74%)
0.29 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
|
× |