zoom 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +27 -0
- data/Rakefile +2 -2
- data/src/rbzoom.c +1 -0
- data/src/rbzoom.h +7 -0
- data/src/rbzoomconnection.c +36 -0
- data/src/rbzoomoptions.c +9 -0
- data/src/rbzoompackage.c +186 -0
- data/test/package_test.rb +136 -0
- data/test/record-update.xml +27 -0
- data/test/record.xml +27 -0
- data/test/search_test.rb +7 -3
- metadata +11 -15
- data/sample/CVS/Entries +0 -3
- data/sample/CVS/Repository +0 -1
- data/sample/CVS/Root +0 -1
- data/test/CVS/Entries +0 -4
- data/test/CVS/Repository +0 -1
- data/test/CVS/Root +0 -1
data/ChangeLog
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
2007-08-12 Walter McGinnis <walter at katipo dot co dot nz>
|
2
|
+
* v0.4.0 - checking in support of ZOOM::Connection#package
|
3
|
+
|
4
|
+
* creating a .4 version of gem
|
5
|
+
|
6
|
+
* AUTHORS
|
7
|
+
- added Walter McGinnis
|
8
|
+
|
9
|
+
* ChangeLog
|
10
|
+
- this entry
|
11
|
+
|
12
|
+
2007-08-11 Nicolai Moles-Benfell <n.molesbenfell@gmail.com>
|
13
|
+
* AUTHORS
|
14
|
+
- added Nicolai Moles-Benfell
|
15
|
+
- added Walter McGinnis
|
16
|
+
|
17
|
+
* src/rbzoomoptions.c:
|
18
|
+
Added support for rubyfying option names that contain hyphens or full stops.
|
19
|
+
|
20
|
+
* src/rbzoomconnection.c:
|
21
|
+
Added ZOOM::Connection#package, a factory method that returns an instance of a ZOOM::Package object.
|
22
|
+
|
23
|
+
Added.
|
24
|
+
* src/rbzoompackage.c:
|
25
|
+
|
26
|
+
|
27
|
+
|
1
28
|
v0.3.0 Tue Jul 10 11:57:40 EDT 2007
|
2
29
|
- new format for this file
|
3
30
|
- added Rakefile
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
RUBY_ZOOM_VERSION = '0.
|
1
|
+
RUBY_ZOOM_VERSION = '0.4.0'
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
@@ -36,7 +36,7 @@ spec = Gem::Specification.new do |s|
|
|
36
36
|
s.version = RUBY_ZOOM_VERSION
|
37
37
|
s.homepage = 'http://ruby-zoom.rubyforge.org'
|
38
38
|
s.platform = Gem::Platform::RUBY
|
39
|
-
s.summary = 'Ruby/ZOOM provides a Ruby binding to the Z40.50 Object-Orientation Model (ZOOM), an abstract object-oriented programming interface to a subset of the services specified by the Z39.50 standard, also known as the international standard ISO 23950.'
|
39
|
+
s.summary = 'Ruby/ZOOM provides a Ruby binding to the Z40.50 Object-Orientation Model (ZOOM), an abstract object-oriented programming interface to a subset of the services specified by the Z39.50 standard, also known as the international standard ISO 23950. This version introduces ZOOM Extended Services.'
|
40
40
|
s.autorequire = 'zoom'
|
41
41
|
s.files =
|
42
42
|
Dir.glob('src/*.c') +
|
data/src/rbzoom.c
CHANGED
data/src/rbzoom.h
CHANGED
@@ -29,6 +29,7 @@ void Init_zoom_connection (VALUE mZoom);
|
|
29
29
|
void Init_zoom_query (VALUE mZoom);
|
30
30
|
void Init_zoom_resultset (VALUE mZoom);
|
31
31
|
void Init_zoom_record (VALUE mZoom);
|
32
|
+
void Init_zoom_package (VALUE mZoom);
|
32
33
|
|
33
34
|
/* rbzoomoptions.c */
|
34
35
|
ZOOM_options ruby_hash_to_zoom_options (VALUE hash);
|
@@ -43,6 +44,12 @@ VALUE rbz_resultset_make (ZOOM_resultset resultset);
|
|
43
44
|
|
44
45
|
/* rbzoomrecord.c */
|
45
46
|
VALUE rbz_record_make (ZOOM_record record);
|
47
|
+
|
48
|
+
/* rbzoompackage.c */
|
49
|
+
VALUE rbz_package_make (ZOOM_connection connection, ZOOM_options options);
|
50
|
+
|
51
|
+
/* rbconnection.c */
|
52
|
+
void rbz_connection_check(VALUE obj);
|
46
53
|
|
47
54
|
/* useful macros */
|
48
55
|
#if !defined (RVAL2CSTR)
|
data/src/rbzoomconnection.c
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
*/
|
24
24
|
static VALUE cZoomConnection;
|
25
25
|
|
26
|
+
|
26
27
|
static VALUE
|
27
28
|
rbz_connection_make (ZOOM_connection connection)
|
28
29
|
{
|
@@ -60,6 +61,15 @@ rbz_connection_get (VALUE obj)
|
|
60
61
|
} \
|
61
62
|
while (0)
|
62
63
|
|
64
|
+
void rbz_connection_check(VALUE obj)
|
65
|
+
{
|
66
|
+
ZOOM_connection connection;
|
67
|
+
|
68
|
+
connection = rbz_connection_get(obj);
|
69
|
+
RAISE_IF_FAILED (connection);
|
70
|
+
}
|
71
|
+
|
72
|
+
|
63
73
|
/*
|
64
74
|
* Class method: open(host, port=nil) { |conn| ... }
|
65
75
|
* host: hostname of the target to connect to.
|
@@ -242,6 +252,31 @@ rbz_connection_search (VALUE self, VALUE criterion)
|
|
242
252
|
return rbz_resultset_make (resultset);
|
243
253
|
}
|
244
254
|
|
255
|
+
|
256
|
+
/*
|
257
|
+
* Method: package()
|
258
|
+
*
|
259
|
+
* Constructs a new extended services ZOOM::Package using this connections host information.
|
260
|
+
*
|
261
|
+
* Note: The Perl script passes this connections options if already set, otherwise constructs a new ZOOM::Option object.
|
262
|
+
* Currently this method always constructs a new ZOOM::Option object for each package.
|
263
|
+
*
|
264
|
+
* Returns: a new ZOOM::Package object,
|
265
|
+
*/
|
266
|
+
static VALUE
|
267
|
+
rbz_connection_package(VALUE self)
|
268
|
+
{
|
269
|
+
ZOOM_connection connection;
|
270
|
+
ZOOM_options options;
|
271
|
+
ZOOM_package package;
|
272
|
+
|
273
|
+
connection = rbz_connection_get (self);
|
274
|
+
options = ZOOM_options_create ();
|
275
|
+
package = rbz_package_make(connection, options);
|
276
|
+
return package;
|
277
|
+
}
|
278
|
+
|
279
|
+
|
245
280
|
void
|
246
281
|
Init_zoom_connection (VALUE mZoom)
|
247
282
|
{
|
@@ -253,6 +288,7 @@ Init_zoom_connection (VALUE mZoom)
|
|
253
288
|
rb_define_method (c, "connect", rbz_connection_connect, -1);
|
254
289
|
rb_define_method (c, "set_option", rbz_connection_set_option, 2);
|
255
290
|
rb_define_method (c, "get_option", rbz_connection_get_option, 1);
|
291
|
+
rb_define_method (c, "package", rbz_connection_package, 0);
|
256
292
|
|
257
293
|
define_zoom_option (c, "implementationName");
|
258
294
|
define_zoom_option (c, "user");
|
data/src/rbzoomoptions.c
CHANGED
@@ -96,6 +96,15 @@ define_zoom_option (VALUE klass, const char *option)
|
|
96
96
|
rubyname [j++] = '_';
|
97
97
|
c = tolower (c);
|
98
98
|
}
|
99
|
+
else if (c == '-')
|
100
|
+
{
|
101
|
+
c = '_';
|
102
|
+
}
|
103
|
+
else if (c == '.')
|
104
|
+
{
|
105
|
+
c = '_';
|
106
|
+
}
|
107
|
+
|
99
108
|
rubyname [j] = c;
|
100
109
|
}
|
101
110
|
rubyname [j] = '\0';
|
data/src/rbzoompackage.c
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2007 Katipo Communications, Ltd.
|
3
|
+
*
|
4
|
+
* This library is free software; you can redistribute it and/or
|
5
|
+
* modify it under the terms of the GNU Lesser General Public
|
6
|
+
* License as published by the Free Software Foundation; either
|
7
|
+
* version 2.1 of the License, or (at your option) any later version.
|
8
|
+
*
|
9
|
+
* This library is distributed in the hope that it will be useful,
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
* Lesser General Public License for more details.
|
13
|
+
*
|
14
|
+
* You should have received a copy of the GNU Lesser General Public
|
15
|
+
* License along with this library; if not, write to the Free Software
|
16
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
+
*/
|
18
|
+
|
19
|
+
#include "rbzoom.h"
|
20
|
+
#include <stdio.h>
|
21
|
+
|
22
|
+
/* Class: ZOOM::Package
|
23
|
+
* This class represents an Extended Services Package: an instruction to the server
|
24
|
+
* to do something not covered by the core parts of the Z39.50 standard
|
25
|
+
*/
|
26
|
+
static VALUE cZoomPackage;
|
27
|
+
|
28
|
+
|
29
|
+
static ZOOM_package
|
30
|
+
rbz_package_get (VALUE obj)
|
31
|
+
{
|
32
|
+
ZOOM_package package;
|
33
|
+
|
34
|
+
if (cZoomPackage == Qnil)
|
35
|
+
rb_raise(rb_eRuntimeError, "cZoomPackage is nil: has destroy() already been called on this Package?");
|
36
|
+
|
37
|
+
Data_Get_Struct (obj, struct ZOOM_package_p, package);
|
38
|
+
assert (package != NULL);
|
39
|
+
|
40
|
+
return package;
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
/* Method: make(connection, options)
|
45
|
+
*
|
46
|
+
* Creates a ZOOM::Package from the connection and options specified.
|
47
|
+
*
|
48
|
+
* Returns: the created ZOOM::Package or Qnil.
|
49
|
+
*/
|
50
|
+
VALUE
|
51
|
+
rbz_package_make (ZOOM_connection connection, ZOOM_options options)
|
52
|
+
{
|
53
|
+
|
54
|
+
ZOOM_package package;
|
55
|
+
|
56
|
+
package = ZOOM_connection_package(connection, options);
|
57
|
+
|
58
|
+
if (cZoomPackage == Qnil)
|
59
|
+
rb_raise(rb_eRuntimeError, "cZoomPackage is nil: has destroy() already been called on this Package?");
|
60
|
+
|
61
|
+
return package != NULL
|
62
|
+
? Data_Wrap_Struct (cZoomPackage,
|
63
|
+
NULL,
|
64
|
+
ZOOM_package_destroy,
|
65
|
+
package)
|
66
|
+
: Qnil;
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
/*
|
71
|
+
* Method: set_option(key, value)
|
72
|
+
* key: the name of the option, as a string.
|
73
|
+
* value: the value of this option (as a string, integer or boolean).
|
74
|
+
*
|
75
|
+
* Sets an option on the package.
|
76
|
+
*
|
77
|
+
* Returns: self.
|
78
|
+
*/
|
79
|
+
static VALUE
|
80
|
+
rbz_package_set_option (VALUE self, VALUE key, VALUE val)
|
81
|
+
{
|
82
|
+
|
83
|
+
ZOOM_package package;
|
84
|
+
|
85
|
+
package = rbz_package_get (self);
|
86
|
+
ZOOM_package_option_set (package,
|
87
|
+
RVAL2CSTR (key),
|
88
|
+
RVAL2CSTR (rb_obj_as_string (val)));
|
89
|
+
|
90
|
+
return self;
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
/*
|
95
|
+
* Method: get_option(key)
|
96
|
+
* key: the name of the option, as a string.
|
97
|
+
*
|
98
|
+
* Gets the value of a package's option.
|
99
|
+
*
|
100
|
+
* Returns: the value of the given option, as a string, integer or boolean.
|
101
|
+
*/
|
102
|
+
static VALUE
|
103
|
+
rbz_package_get_option (VALUE self, VALUE key)
|
104
|
+
{
|
105
|
+
ZOOM_package package;
|
106
|
+
const char *value;
|
107
|
+
|
108
|
+
package = rbz_package_get (self);
|
109
|
+
|
110
|
+
value = ZOOM_package_option_get (package,
|
111
|
+
RVAL2CSTR (key));
|
112
|
+
|
113
|
+
return zoom_option_value_to_ruby_value (value);
|
114
|
+
}
|
115
|
+
|
116
|
+
/*
|
117
|
+
* Method: send(type)
|
118
|
+
* type: the actual extended service package type to be sent, as a string.
|
119
|
+
*
|
120
|
+
* Sends the package.
|
121
|
+
*
|
122
|
+
* Returns: self.
|
123
|
+
*/
|
124
|
+
static VALUE
|
125
|
+
rbz_package_send(VALUE self, VALUE type)
|
126
|
+
{
|
127
|
+
ZOOM_package package;
|
128
|
+
const char *typeChar;
|
129
|
+
|
130
|
+
package = rbz_package_get (self);
|
131
|
+
|
132
|
+
typeChar = StringValuePtr(type);
|
133
|
+
ZOOM_package_send(package, typeChar);
|
134
|
+
|
135
|
+
return self;
|
136
|
+
}
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
/* Interface to a subset of the Z39.50 extended services.
|
141
|
+
*/
|
142
|
+
void
|
143
|
+
Init_zoom_package (VALUE mZoom)
|
144
|
+
{
|
145
|
+
VALUE c;
|
146
|
+
|
147
|
+
c = rb_define_class_under (mZoom, "Package", rb_cObject);
|
148
|
+
|
149
|
+
/* Remove the default constructor to force initialization through Connection#package. */
|
150
|
+
rb_undef_method (CLASS_OF (c), "new");
|
151
|
+
|
152
|
+
/* Instance methods */
|
153
|
+
rb_define_method (c, "set_option", rbz_package_set_option, 2);
|
154
|
+
rb_define_method (c, "get_option", rbz_package_get_option, 1);
|
155
|
+
rb_define_method (c, "send", rbz_package_send, 1);
|
156
|
+
|
157
|
+
// Common Options
|
158
|
+
define_zoom_option (c, "package-name");
|
159
|
+
define_zoom_option (c, "user-id");
|
160
|
+
define_zoom_option (c, "function");
|
161
|
+
define_zoom_option (c, "waitAction");
|
162
|
+
define_zoom_option (c, "targetReference");
|
163
|
+
|
164
|
+
// Item Order, type must be set to itemorder in ZOOM_package_send.
|
165
|
+
define_zoom_option (c, "contact-name");
|
166
|
+
define_zoom_option (c, "contact-phone");
|
167
|
+
define_zoom_option (c, "contact-email");
|
168
|
+
define_zoom_option (c, "itemorder-item");
|
169
|
+
|
170
|
+
// Record Update, type must be set to update in ZOOM_package_send.
|
171
|
+
define_zoom_option (c, "action");
|
172
|
+
define_zoom_option (c, "recordIdOpaque");
|
173
|
+
define_zoom_option (c, "recordIdNumber");
|
174
|
+
define_zoom_option (c, "record");
|
175
|
+
define_zoom_option (c, "syntax");
|
176
|
+
define_zoom_option (c, "databaseName");
|
177
|
+
define_zoom_option (c, "correlationInfo.note");
|
178
|
+
define_zoom_option (c, "correlationInfo.id");
|
179
|
+
define_zoom_option (c, "elementSetName");
|
180
|
+
|
181
|
+
// Database Create, type must be set to create in ZOOM_package_send.
|
182
|
+
// Database Drop, type must be set to drop in ZOOM_package_send.
|
183
|
+
define_zoom_option (c, "databaseName");
|
184
|
+
|
185
|
+
cZoomPackage = c;
|
186
|
+
}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "zoom"
|
3
|
+
|
4
|
+
class TestPackage < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@connection = ZOOM::Connection.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_connection_package
|
11
|
+
assert(@connection.respond_to?('package'))
|
12
|
+
p = @connection.package
|
13
|
+
assert_equal(p.class.to_s, 'ZOOM::Package')
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
def test_option_returns_same_value
|
18
|
+
p = @connection.package
|
19
|
+
p.action = 'update'
|
20
|
+
assert_equal('update', p.action)
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_options_containing_hyphen
|
24
|
+
# option contact-name
|
25
|
+
p = @connection.package
|
26
|
+
assert(p.respond_to?('contact_name'))
|
27
|
+
assert(p.respond_to?('contact_name='))
|
28
|
+
assert(p.respond_to?('set_contact_name'))
|
29
|
+
|
30
|
+
p.contact_name = 'contact_name value'
|
31
|
+
assert_equal('contact_name value', p.contact_name)
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def test_option_containing_fullstop
|
36
|
+
#option correlationInfo.note
|
37
|
+
p = @connection.package
|
38
|
+
assert(p.respond_to?('correlation_info_note'))
|
39
|
+
assert(true, p.respond_to?('correlation_info_note='))
|
40
|
+
assert_equal(true, p.respond_to?('set_correlation_info_note'))
|
41
|
+
|
42
|
+
p.correlation_info_note = 'correlation_info_note value'
|
43
|
+
assert_equal('correlation_info_note value', p.correlation_info_note)
|
44
|
+
end
|
45
|
+
|
46
|
+
# test z39.50 instance that supports extended services by connecting to zebra instance
|
47
|
+
# TODO: get a more permanent test zebra server hosted
|
48
|
+
# THESE ARE CURRENTLY BROKEN
|
49
|
+
# record syntax might be not quite right
|
50
|
+
# and thus updates are creating new records (not matching old record)
|
51
|
+
# and destroys are failing, too (also not matching old record)
|
52
|
+
# def test_crud_record
|
53
|
+
# @id = 'oai:casanova.katipo.co.nz:site:WebLink:2'
|
54
|
+
# @record = File.read('test/record.xml')
|
55
|
+
# @record_update = File.read('test/record-update.xml')
|
56
|
+
# @options = { 'user' => 'test', 'password' => 'test' }
|
57
|
+
|
58
|
+
# # create
|
59
|
+
# c = ZOOM::Connection.new(@options).connect('casanova.katipo.co.nz', 9998)
|
60
|
+
# c.database_name = 'test'
|
61
|
+
# p = c.package
|
62
|
+
# p.function = 'create'
|
63
|
+
# p.wait_action = 'waitIfPossible'
|
64
|
+
# p.syntax = 'no syntax'
|
65
|
+
|
66
|
+
# p.action = 'specialUpdate'
|
67
|
+
# p.record = @record
|
68
|
+
# p.record_id_opaque = @id
|
69
|
+
|
70
|
+
# p.send('update')
|
71
|
+
# p.send('commit')
|
72
|
+
|
73
|
+
# # make sure it's there
|
74
|
+
# ZOOM::Connection.open('casanova.katipo.co.nz', 9998) do |conn|
|
75
|
+
# conn.database_name = 'test'
|
76
|
+
# conn.preferred_record_syntax = 'XML'
|
77
|
+
# result_set = conn.search("@attr 1=12 @attr 4=3 \"#{@id}\"")
|
78
|
+
# assert_equal 1, result_set.length
|
79
|
+
# end
|
80
|
+
|
81
|
+
# # update
|
82
|
+
# c = ZOOM::Connection.new(@options).connect('casanova.katipo.co.nz', 9998)
|
83
|
+
# c.database_name = 'test'
|
84
|
+
# p = c.package
|
85
|
+
|
86
|
+
# p.function = 'create'
|
87
|
+
# p.wait_action = 'waitIfPossible'
|
88
|
+
# p.syntax = 'no syntax'
|
89
|
+
|
90
|
+
# p.action = 'specialUpdate'
|
91
|
+
# p.record = @record_update
|
92
|
+
# p.record_id_opaque = @id
|
93
|
+
# p.send('update')
|
94
|
+
# p.send('commit')
|
95
|
+
|
96
|
+
# # confirm update record is there
|
97
|
+
# ZOOM::Connection.open('casanova.katipo.co.nz', 9998) do |conn|
|
98
|
+
# conn.database_name = 'test'
|
99
|
+
# conn.preferred_record_syntax = 'XML'
|
100
|
+
# result_set = conn.search("@attr 1=1016 woohoo")
|
101
|
+
# assert_equal 1, result_set.length
|
102
|
+
# end
|
103
|
+
|
104
|
+
# # confirm original record has been written over
|
105
|
+
# ZOOM::Connection.open('casanova.katipo.co.nz', 9998) do |conn|
|
106
|
+
# conn.database_name = 'test'
|
107
|
+
# conn.preferred_record_syntax = 'XML'
|
108
|
+
# result_set = conn.search("@attr 1=4 kete")
|
109
|
+
# assert_equal 1, result_set.length
|
110
|
+
# end
|
111
|
+
|
112
|
+
# # cleanup
|
113
|
+
# c2 = ZOOM::Connection.new(@options).connect('casanova.katipo.co.nz', 9998)
|
114
|
+
# c2.database_name = 'test'
|
115
|
+
# p2 = c2.package
|
116
|
+
|
117
|
+
# p2.function = 'create'
|
118
|
+
# p2.wait_action = 'waitIfPossible'
|
119
|
+
# p2.syntax = 'no syntax'
|
120
|
+
|
121
|
+
# p2.action = 'recordDelete'
|
122
|
+
# p2.record = @record_update
|
123
|
+
# p2.record_id_opaque = @id
|
124
|
+
# p2.send("update")
|
125
|
+
# p2.send("commit")
|
126
|
+
|
127
|
+
# # make sure the file has been destroyed
|
128
|
+
# ZOOM::Connection.open('casanova.katipo.co.nz', 9998) do |conn|
|
129
|
+
# conn.database_name = 'test'
|
130
|
+
# conn.preferred_record_syntax = 'XML'
|
131
|
+
# result_set = conn.search("@attr 1=12 @attr 4=3 \"#{@id}\"")
|
132
|
+
# assert_equal 0, result_set.length
|
133
|
+
# end
|
134
|
+
# end
|
135
|
+
|
136
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns="http://www.openarchives.org/OAI/2.0/">
|
3
|
+
<responseDate>2007-01-14 18:30:51</responseDate>
|
4
|
+
<request metadataPrefix="oai_dc" identifier="oai:casanova.katipo.co.nz:site:WebLink:1" verb="GetRecord">http://localhost/site/web_links/show/1.xml</request>
|
5
|
+
<GetRecord>
|
6
|
+
<record>
|
7
|
+
<header>
|
8
|
+
<identifier>oai:casanova.katipo.co.nz:site:WebLink:2</identifier>
|
9
|
+
<datestamp>2007-01-14</datestamp>
|
10
|
+
</header>
|
11
|
+
<metadata>
|
12
|
+
<oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
13
|
+
<dc:identifier>http://localhost/site/web_links/show/1</dc:identifier>
|
14
|
+
<dc:title>Kete.net</dc:title>
|
15
|
+
<dc:description>This is the site that describes the Kete project, woohoo!</dc:description>
|
16
|
+
<dc:description>http://kete.net.nz/</dc:description>
|
17
|
+
<dc:subject>kete</dc:subject>
|
18
|
+
<dc:date>Sun Jan 14 18:29:54 +1300 2007</dc:date>
|
19
|
+
<dc:creator>admin</dc:creator>
|
20
|
+
<dc:contributor>admin</dc:contributor>
|
21
|
+
<dc:type>InteractiveResource</dc:type>
|
22
|
+
<dc:format>text/html</dc:format>
|
23
|
+
</oai_dc:dc>
|
24
|
+
</metadata>
|
25
|
+
</record>
|
26
|
+
</GetRecord>
|
27
|
+
</OAI-PMH>
|
data/test/record.xml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns="http://www.openarchives.org/OAI/2.0/">
|
3
|
+
<responseDate>2007-01-14 18:30:51</responseDate>
|
4
|
+
<request metadataPrefix="oai_dc" identifier="oai:casanova.katipo.co.nz:site:WebLink:1" verb="GetRecord">http://localhost/site/web_links/show/1.xml</request>
|
5
|
+
<GetRecord>
|
6
|
+
<record>
|
7
|
+
<header>
|
8
|
+
<identifier>oai:casanova.katipo.co.nz:site:WebLink:2</identifier>
|
9
|
+
<datestamp>2007-01-14</datestamp>
|
10
|
+
</header>
|
11
|
+
<metadata>
|
12
|
+
<oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
13
|
+
<dc:identifier>http://localhost/site/web_links/show/1</dc:identifier>
|
14
|
+
<dc:title>Kete.net</dc:title>
|
15
|
+
<dc:description>This is the site that describes the Kete project.</dc:description>
|
16
|
+
<dc:description>http://kete.net.nz/</dc:description>
|
17
|
+
<dc:subject>kete</dc:subject>
|
18
|
+
<dc:date>Sun Jan 14 18:29:54 +1300 2007</dc:date>
|
19
|
+
<dc:creator>admin</dc:creator>
|
20
|
+
<dc:contributor>admin</dc:contributor>
|
21
|
+
<dc:type>InteractiveResource</dc:type>
|
22
|
+
<dc:format>text/html</dc:format>
|
23
|
+
</oai_dc:dc>
|
24
|
+
</metadata>
|
25
|
+
</record>
|
26
|
+
</GetRecord>
|
27
|
+
</OAI-PMH>
|
data/test/search_test.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
class SearchTest < Test::Unit::TestCase
|
2
|
-
|
2
|
+
# Walter McGinnis, 2007-08-06
|
3
|
+
# for some reason the result as string has an extra \n at the end
|
4
|
+
# that now needs to be trimmed off the end
|
5
|
+
# by doing this with a gsub for replacing \n\n pattern with a single \n
|
6
|
+
# if this changes back to a single \n in the future
|
7
|
+
# this shouldn't break
|
3
8
|
def test_search_results
|
4
9
|
ZOOM::Connection.open('z3950.loc.gov', 7090) do |conn|
|
5
10
|
conn.database_name = 'Voyager'
|
6
11
|
conn.preferred_record_syntax = 'USMARC'
|
7
12
|
result_set = conn.search('@attr 1=7 0253333490')
|
8
13
|
assert_equal 1, result_set.length
|
9
|
-
assert_equal File.read('test/record.txt'), result_set[0].to_s
|
14
|
+
assert_equal File.read('test/record.txt'), result_set[0].to_s.gsub("\n\n", "\n")
|
10
15
|
assert_equal File.read('test/record.dat'), result_set[0].raw
|
11
16
|
end
|
12
17
|
end
|
13
|
-
|
14
18
|
end
|
metadata
CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: zoom
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-
|
8
|
-
summary: Ruby/ZOOM provides a Ruby binding to the Z40.50 Object-Orientation Model (ZOOM), an abstract object-oriented programming interface to a subset of the services specified by the Z39.50 standard, also known as the international standard ISO 23950.
|
6
|
+
version: 0.4.0
|
7
|
+
date: 2007-08-12 00:00:00 +12:00
|
8
|
+
summary: Ruby/ZOOM provides a Ruby binding to the Z40.50 Object-Orientation Model (ZOOM), an abstract object-oriented programming interface to a subset of the services specified by the Z39.50 standard, also known as the international standard ISO 23950. This version introduces ZOOM Extended Services.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email:
|
@@ -30,26 +30,22 @@ authors: []
|
|
30
30
|
|
31
31
|
files:
|
32
32
|
- src/rbzoom.c
|
33
|
+
- src/rbzoomconnection.c
|
33
34
|
- src/rbzoomoptions.c
|
35
|
+
- src/rbzoompackage.c
|
34
36
|
- src/rbzoomquery.c
|
35
|
-
- src/rbzoomresultset.c
|
36
37
|
- src/rbzoomrecord.c
|
37
|
-
- src/
|
38
|
+
- src/rbzoomresultset.c
|
38
39
|
- src/rbzoom.h
|
39
40
|
- src/extconf.rb
|
40
|
-
- test/
|
41
|
+
- test/package_test.rb
|
42
|
+
- test/record-update.xml
|
41
43
|
- test/record.dat
|
42
|
-
- test/CVS
|
43
44
|
- test/record.txt
|
44
|
-
- test/
|
45
|
-
- test/
|
46
|
-
- test/CVS/Repository
|
47
|
-
- sample/needle.rb
|
48
|
-
- sample/CVS
|
45
|
+
- test/record.xml
|
46
|
+
- test/search_test.rb
|
49
47
|
- sample/hello.rb
|
50
|
-
- sample/
|
51
|
-
- sample/CVS/Root
|
52
|
-
- sample/CVS/Repository
|
48
|
+
- sample/needle.rb
|
53
49
|
- README
|
54
50
|
- ChangeLog
|
55
51
|
- Rakefile
|
data/sample/CVS/Entries
DELETED
data/sample/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-zoom/sample
|
data/sample/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:ext:esummers@rubyforge.org:/var/cvs/ruby-zoom
|
data/test/CVS/Entries
DELETED
data/test/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-zoom/test
|
data/test/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:ext:esummers@rubyforge.org:/var/cvs/ruby-zoom
|