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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdaadc48837d0b67408665c633df70bb5daabc1d
4
- data.tar.gz: 85706c81861c1b37aa945fc6acabc92df0d42b58
3
+ metadata.gz: fe1da23ef28478f294186858a53686d1ffd4f29d
4
+ data.tar.gz: b793ba5b0a34fe5316befca0be96054a9be1f933
5
5
  SHA512:
6
- metadata.gz: 84e6bd566564656a1f99deb1d9962e52344f140e2c4dda79834489c2f1d2983f266f1a5c7d8fc9b511edccceca694681e91443c1c68c1faf0309e4000b494363
7
- data.tar.gz: d4448598954cbd8918cd2d7f91bd314dbf05ff99f0f5985ec1236b8d8c51e12fdb3f4018989999d5f8a7af03e7d5a0e76876950d44af7bf099073781b7a8a13f
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
- # A URL for a given service
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
- @response ||= client.get_response(URI(url)).body
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
@@ -28,7 +28,7 @@ module CONTENTdmAPI
28
28
  private
29
29
 
30
30
  def all_params
31
- params.concat([format])
31
+ params.concat([format]).uniq
32
32
  end
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module CONTENTdmAPI
2
- VERSION = '0.3.4'.freeze
2
+ VERSION = '0.3.5'.freeze
3
3
  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
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-02 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler