sru 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sru/client.rb +5 -5
  2. metadata +46 -38
@@ -24,7 +24,7 @@ module SRU
24
24
  # client.scan('king tut', :maximumTerms => 12).each {|term| puts term}
25
25
 
26
26
  class Client
27
-
27
+ attr_accessor :version
28
28
  # creates a client object which will automatically perform an
29
29
  # explain request to determine the version to be used in
30
30
  # subsequent requests.
@@ -36,7 +36,7 @@ module SRU
36
36
  when 'libxml'
37
37
  begin
38
38
  require 'rubygems'
39
- require 'xml/libxml'
39
+ require 'libxml'
40
40
  rescue
41
41
  raise SRU::Exception, "unknown parser: #{@parser}", caller
42
42
  end
@@ -103,7 +103,7 @@ module SRU
103
103
 
104
104
  def get_doc(hash)
105
105
  # all requests get a version
106
- hash[:version] = @version
106
+ hash[:version] = @version unless hash[:version]
107
107
 
108
108
 
109
109
  # don't want to monkey with the original
@@ -121,11 +121,11 @@ module SRU
121
121
  # load appropriate parser
122
122
  case @parser
123
123
  when 'libxml'
124
- xmlObj = LibXML::XML::Parser.new()
124
+ xmlObj = LibXML::XML::Parser.string(xml)
125
125
  # not sure why but the explain namespace does bad things to
126
126
  # libxml
127
127
  #xml = xml.gsub(' xmlns="http://explain.z3950.org/dtd/2.0/"', '')
128
- xmlObj.string = xml
128
+
129
129
  return xmlObj.parse
130
130
  when 'rexml'
131
131
  return REXML::Document.new(xml)
metadata CHANGED
@@ -1,57 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: sru
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.0.5
7
- date: 2008-09-12 00:00:00 -07:00
8
- summary: a Ruby library for Search and Retrieve by URL
9
- require_paths:
10
- - lib
11
- email: ehs@pobox.com
12
- homepage: http://www.textualize.com/sruby
13
- rubyforge_project:
14
- description:
15
- autorequire: sru
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.0.6
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Ed Summers
8
+ autorequire: sru
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-16 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: ehs@pobox.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
31
24
  files:
32
- - lib/sru
33
- - lib/sru/xpath.rb
34
- - lib/sru/explain.rb
25
+ - lib/sru/client.rb
35
26
  - lib/sru/exception.rb
36
- - lib/sru/search_retrieve.rb
27
+ - lib/sru/explain.rb
37
28
  - lib/sru/response.rb
38
29
  - lib/sru/scan.rb
30
+ - lib/sru/search_retrieve.rb
39
31
  - lib/sru/term.rb
40
- - lib/sru/client.rb
32
+ - lib/sru/xpath.rb
41
33
  - lib/sru.rb
42
- - test/tc_rexml_client_test.rb
43
34
  - test/tc_libxml_client_test.rb
44
- test_files: []
35
+ - test/tc_rexml_client_test.rb
36
+ has_rdoc: true
37
+ homepage: http://www.textualize.com/sruby
38
+ licenses: []
45
39
 
40
+ post_install_message:
46
41
  rdoc_options: []
47
42
 
48
- extra_rdoc_files: []
49
-
50
- executables: []
51
-
52
- extensions: []
53
-
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
54
57
  requirements: []
55
58
 
56
- dependencies: []
59
+ rubyforge_project:
60
+ rubygems_version: 1.3.4
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: a Ruby library for Search and Retrieve by URL
64
+ test_files: []
57
65