contentdm_api 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contentdm_api/request.rb +19 -7
- data/lib/contentdm_api/service.rb +1 -1
- data/lib/contentdm_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe1da23ef28478f294186858a53686d1ffd4f29d
|
4
|
+
data.tar.gz: b793ba5b0a34fe5316befca0be96054a9be1f933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86d678241bee5a87e989038328b717e0ff09818f66d899871008e8cc6045c5707612dd13b757325b1704dcda3da151d612600c7537db434a98851fdc06046f80
|
7
|
+
data.tar.gz: 3968d5381a974b3941bc27b2de9fa2a5369d3b48be7706cf83aecddc32ad622ee54eba4a4851da7ceb8c66d1086a6f4946544be2b02d31ae69ec102da22491b0
|
@@ -20,20 +20,32 @@ module CONTENTdmAPI
|
|
20
20
|
#
|
21
21
|
# @return [String] either XML or JSON
|
22
22
|
def fetch
|
23
|
-
request
|
23
|
+
request.body
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
# @return [String] a url string
|
29
|
-
def url
|
30
|
-
"#{base_url}?q=#{service.url_params}"
|
26
|
+
def uri
|
27
|
+
@uri = URI.parse(unencoded_url)
|
31
28
|
end
|
32
29
|
|
33
30
|
private
|
34
31
|
|
32
|
+
def http
|
33
|
+
http = client.new(uri.host, uri.port)
|
34
|
+
http.read_timeout = 300
|
35
|
+
http.open_timeout = 120
|
36
|
+
http.use_ssl = (uri.scheme == "https")
|
37
|
+
http
|
38
|
+
end
|
39
|
+
|
35
40
|
def request
|
36
|
-
|
41
|
+
http.request(client::Get.new(uri.request_uri))
|
42
|
+
end
|
43
|
+
|
44
|
+
# A URL for a given service
|
45
|
+
#
|
46
|
+
# @return [String] a url string
|
47
|
+
def unencoded_url
|
48
|
+
"#{base_url}?q=#{service.url_params}"
|
37
49
|
end
|
38
50
|
end
|
39
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentdm_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fennell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|