sru 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sru/client.rb CHANGED
@@ -117,7 +117,11 @@ module SRU
117
117
  uri.query = parts.join('&')
118
118
  # fetch the xml and build/return a document object from it
119
119
  begin
120
- xml = Net::HTTP.get(uri)
120
+ res = Net::HTTP.start(uri.host, uri.port) {|http|
121
+ http.get(uri.request_uri, { "Accept" => "text/xml, application/xml"})
122
+ }
123
+
124
+ xml = res.body
121
125
  # load appropriate parser
122
126
  case @parser
123
127
  when 'libxml'
@@ -0,0 +1,8 @@
1
+ class TCHTTPClientTests < Test::Unit::TestCase
2
+ def test_content_negotiation
3
+ client = SRU::Client.new 'http://viaf.org/search'
4
+ assert_nothing_raised do
5
+ results = client.search_retrieve 'local.names any twain'
6
+ end
7
+ end
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Summers
@@ -9,7 +9,7 @@ autorequire: sru
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-16 00:00:00 -04:00
12
+ date: 2010-02-10 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -31,6 +31,7 @@ files:
31
31
  - lib/sru/term.rb
32
32
  - lib/sru/xpath.rb
33
33
  - lib/sru.rb
34
+ - test/tc_http_client_test.rb
34
35
  - test/tc_libxml_client_test.rb
35
36
  - test/tc_rexml_client_test.rb
36
37
  has_rdoc: true
@@ -57,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
58
  requirements: []
58
59
 
59
60
  rubyforge_project:
60
- rubygems_version: 1.3.4
61
+ rubygems_version: 1.3.5
61
62
  signing_key:
62
63
  specification_version: 3
63
64
  summary: a Ruby library for Search and Retrieve by URL