zoom 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +81 -90
- data/README +46 -15
- data/Rakefile +13 -2
- data/sample/needle.rb +1 -0
- data/src/rbzoom.c +1 -0
- data/src/rbzoomconnection.c +27 -10
- data/src/rbzoompackage.c +20 -7
- data/src/rbzoomquery.c +11 -4
- data/src/rbzoomrecord.c +24 -10
- data/src/rbzoomresultset.c +52 -8
- data/test/package_live.rb +106 -0
- data/test/package_test.rb +0 -95
- data/test/search_batch_test.rb +16 -0
- data/test/thread_test.rb +21 -0
- data/test/zebra/key/empty_file +1 -0
- data/test/zebra/lock/empty_file +1 -0
- data/test/zebra/records/programming_ruby.xml +104 -0
- data/test/zebra/records/programming_ruby_update.xml +104 -0
- data/test/zebra/register/empty_file +1 -0
- data/test/zebra/shadow/empty_file +1 -0
- data/test/zebra/tab/bib1.att +104 -0
- data/test/zebra/tab/default.idx +59 -0
- data/test/zebra/tab/numeric.chr +13 -0
- data/test/zebra/tab/record.abs +43 -0
- data/test/zebra/tab/string.chr +42 -0
- data/test/zebra/tab/usmarc.mar +3 -0
- data/test/zebra/zebra.cfg +40 -0
- metadata +32 -9
data/ChangeLog
CHANGED
@@ -1,176 +1,167 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
28
|
-
v0.3.0 Tue Jul 10 11:57:40 EDT 2007
|
29
|
-
- new format for this file
|
1
|
+
v0.4.1 Tue Nov 20 08:05:53 EST 2007
|
2
|
+
- record retrieval has changed with batch_download branch merged into trunk.
|
3
|
+
this allows for records to be downloaded in a batch and tries to fall back
|
4
|
+
to record at a time download if batch download fails.
|
5
|
+
- removed second definition of databaseName from rbzoompackage.c
|
6
|
+
- added RDoc style documentation to C source
|
7
|
+
- added tests for batch retrieval and a connection within a Thread
|
8
|
+
|
9
|
+
v0.4.0 - checking in support of ZOOM::Connection#package
|
10
|
+
- creating a .4 version of gem
|
11
|
+
- added Walter McGinnis, Nicolai Moles-Benfell To Authors
|
12
|
+
- src/rbzoomoptions.c: Added support for rubyfying option names that
|
13
|
+
contain hyphens or full stops.
|
14
|
+
- src/rbzoomconnection.c: Added ZOOM::Connection#package, a factory method
|
15
|
+
that returns an instance of a ZOOM::Package object.
|
16
|
+
- added src/rbzoompackage.c:
|
17
|
+
|
18
|
+
v0.3.0 Tue Jul 10 11:57:40 EDT 2007
|
19
|
+
- new format for this file, all changes are summarized under a version
|
20
|
+
no need to recreate commit messages in a text file when svn can tell us them
|
30
21
|
- added Rakefile
|
31
22
|
- applied patch from Jason Ronallo to enable raw method on records
|
32
23
|
- added test suite
|
33
24
|
- created gem for rubyforge
|
34
25
|
|
35
26
|
2007-05-05 Ed Summers <ehs@pobox.com>
|
36
|
-
|
37
|
-
|
27
|
+
- added Ed Summers
|
28
|
+
- src/lib/* removed marc.rb since it isn't used and conflicts with the marc
|
29
|
+
gem
|
38
30
|
|
39
|
-
|
40
|
-
- removed marc.rb since it isn't used and conflicts with the marc gem
|
31
|
+
# Older format preserved for posterity ...
|
41
32
|
|
42
33
|
2006-09-21 Laurent Sansonetti <lrz@chopine.be>
|
43
34
|
|
44
|
-
|
45
|
-
|
46
|
-
|
35
|
+
* ChangeLog,
|
36
|
+
README,
|
37
|
+
src/**/*.{c,h,rb}:
|
47
38
|
|
48
|
-
|
39
|
+
s/gnome.org/chopine.be/g.
|
49
40
|
|
50
41
|
2006-09-21 Devin Bayer <devin@freeshell.org>
|
51
42
|
|
52
|
-
|
43
|
+
* .cvsignore:
|
53
44
|
|
54
|
-
|
45
|
+
Ignores zoom.bundle.
|
55
46
|
|
56
47
|
* sample/needle.rb:
|
57
48
|
|
58
|
-
|
49
|
+
Updated the needle demo application.
|
59
50
|
|
60
51
|
* src/rbzoomconnection.c:
|
61
52
|
|
62
|
-
|
53
|
+
Do not fail when reading options.
|
63
54
|
|
64
55
|
2006-08-22 Laurent Sansonetti <lrz@chopine.be>
|
65
56
|
|
66
|
-
|
57
|
+
* AUTHORS:
|
67
58
|
|
68
|
-
|
69
|
-
|
59
|
+
- Updated my e-mail address ;
|
60
|
+
- Added Devin.
|
70
61
|
|
71
62
|
2006-08-22 Devin Bayer <devin@freeshell.org>
|
72
63
|
|
73
|
-
|
64
|
+
* src/rbzoomrecord.c:
|
74
65
|
|
75
|
-
|
66
|
+
Added ZOOM::Record#raw, to grab a marc record in marc format.
|
76
67
|
|
77
68
|
2006-08-20 Devin Bayer <devin@freeshell.org>
|
78
69
|
|
79
|
-
|
70
|
+
* sample/needle.rb:
|
80
71
|
|
81
|
-
|
72
|
+
Added new sample, contributed by Devin Bayer.
|
82
73
|
|
83
74
|
=== Ruby/ZOOM 0.2.2 ===
|
84
75
|
|
85
76
|
2005-11-08 Laurent Sansonetti <lrz@chopine.be>
|
86
77
|
|
87
|
-
|
78
|
+
* README:
|
88
79
|
|
89
|
-
|
80
|
+
Added a note about YAZ's --enable-shared problem.
|
90
81
|
|
91
|
-
|
82
|
+
* AUTHORS:
|
92
83
|
|
93
|
-
|
84
|
+
Added Pascal and Matt.
|
94
85
|
|
95
86
|
2005-11-08 Matt Vanderpol <matt@vanderpol.net>
|
96
87
|
|
97
|
-
|
88
|
+
* src/rbzoomquery.c (.new_prefix, .new_cql):
|
98
89
|
|
99
|
-
|
90
|
+
Fixed constructors.
|
100
91
|
|
101
92
|
=== Ruby/ZOOM 0.2.1 ===
|
102
93
|
|
103
94
|
2005-09-23 Pascal Terjan <pterjan@linuxfr.org>
|
104
95
|
|
105
|
-
|
96
|
+
* src/rbzoomoptions.c:
|
106
97
|
|
107
|
-
|
98
|
+
Fixes segfault when rubyfying the option name.
|
108
99
|
|
109
100
|
=== Ruby/ZOOM 0.2.0 ===
|
110
101
|
|
111
102
|
2005-08-02 Laurent Sansonetti <lrz@chopine.be>
|
112
103
|
|
113
|
-
|
104
|
+
* src/rbzoomresultset.rb (#[]):
|
114
105
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
106
|
+
Retrieves the record one by one using ZOOM_resultset_record instead
|
107
|
+
of getting them all in once with ZOOM_resultset_records (for a strange
|
108
|
+
reason sometimes the resultset was not empty but ZOOM_resultset_records
|
109
|
+
used to return empty records).
|
119
110
|
|
120
111
|
2005-07-19 Laurent Sansonetti <lrz@chopine.be>
|
121
112
|
|
122
|
-
|
113
|
+
* src/lib/marc.rb:
|
123
114
|
|
124
|
-
|
115
|
+
Added an experimental MARC decoder.
|
125
116
|
|
126
117
|
=== Ruby/ZOOM 0.1.0 ===
|
127
118
|
|
128
119
|
2005-03-18 Laurent Sansonetti <lrz@chopine.be>
|
129
120
|
|
130
|
-
|
131
|
-
|
132
|
-
|
121
|
+
* COPYING.LIB,
|
122
|
+
AUTHORS,
|
123
|
+
README:
|
133
124
|
|
134
|
-
|
125
|
+
Added.
|
135
126
|
|
136
|
-
|
137
|
-
|
127
|
+
* src/rbzoomconnection.c,
|
128
|
+
src/rbzoomquery.c:
|
138
129
|
|
139
|
-
|
130
|
+
Fixed documentation.
|
140
131
|
|
141
|
-
|
132
|
+
* src/rbzoomresultset.c (#[]):
|
142
133
|
|
143
|
-
|
144
|
-
|
134
|
+
- Range objects are supported ;
|
135
|
+
- Do not clone nil objects.
|
145
136
|
|
146
137
|
2005-03-17 Laurent Sansonetti <lrz@chopine.be>
|
147
138
|
|
148
|
-
|
149
|
-
|
139
|
+
* doc/.cvsignore,
|
140
|
+
doc/gendoc.sh:
|
150
141
|
|
151
|
-
|
142
|
+
Added.
|
152
143
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
144
|
+
* src/rbzoom.c,
|
145
|
+
src/rbzoom.h,
|
146
|
+
src/rbzoomconnection.c,
|
147
|
+
src/rbzoomoptions.c,
|
148
|
+
src/rbzoomquery.c,
|
149
|
+
src/rbzoomrecord.c,
|
150
|
+
src/rbzoomresultset.c:
|
160
151
|
|
161
|
-
|
152
|
+
Added extdoc documentation + LGPL headers.
|
162
153
|
|
163
154
|
2005-03-16 Laurent Sansonetti <lrz@chopine.be>
|
164
155
|
|
165
|
-
|
156
|
+
* src/rbzoomrecord.c (#database, #syntax, #render, #xml):
|
166
157
|
|
167
|
-
|
158
|
+
Added.
|
168
159
|
|
169
|
-
|
170
|
-
|
160
|
+
* src/rbzoom.c,
|
161
|
+
sample/hello.rb:
|
171
162
|
|
172
|
-
|
163
|
+
Renamed the module name as 'ZOOM'.
|
173
164
|
|
174
165
|
2005-03-14 Laurent Sansonetti <lrz@chopine.be>
|
175
166
|
|
176
|
-
|
167
|
+
Initial RubyForge revision.
|
data/README
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Ruby/ZOOM
|
1
|
+
= Ruby/ZOOM
|
2
2
|
=========
|
3
3
|
|
4
4
|
Ruby/ZOOM provides a Ruby binding to the Z39.50 Object-Orientation Model
|
@@ -13,8 +13,7 @@ any ZOOM compliant implementation.
|
|
13
13
|
Ruby/ZOOM is free-software, covered by the GNU Lesser General Public License
|
14
14
|
and provided without any warranties of any kind.
|
15
15
|
|
16
|
-
Requirements
|
17
|
-
------------
|
16
|
+
== Requirements
|
18
17
|
|
19
18
|
Ruby: http://www.ruby-lang.org/
|
20
19
|
YAZ (*): http://www.indexdata.dk/yaz/
|
@@ -23,28 +22,61 @@ Requirements
|
|
23
22
|
script before building YAZ. Ruby/ZOOM requires a YAZ shared library
|
24
23
|
and YAZ does not build it by default.
|
25
24
|
|
26
|
-
Install
|
27
|
-
-------
|
25
|
+
== Install
|
28
26
|
|
29
27
|
0. install Ruby
|
30
28
|
1. install YAZ
|
31
29
|
2. gem install ruby-zoom
|
32
30
|
|
33
|
-
Build from Source
|
34
|
-
-----------------
|
31
|
+
== Build from Source
|
35
32
|
|
36
|
-
0. checkout out code from
|
33
|
+
0. checkout out code from svn at rubyforge
|
37
34
|
1. install Rake
|
38
35
|
2. rake
|
39
|
-
|
36
|
+
3. gem install pkg/zoom-*.gem
|
40
37
|
|
41
|
-
Samples
|
42
|
-
-------
|
38
|
+
== Samples
|
43
39
|
|
44
40
|
Some programming examples are available in the `sample' directory.
|
45
41
|
|
46
|
-
|
47
|
-
|
42
|
+
== Canonical Sample Program
|
43
|
+
|
44
|
+
To give a flavour of the Ruby binding, here is ZOOM's equivalent of the
|
45
|
+
``Hello World'' program: a tiny Z39.50 client that fetches and displays
|
46
|
+
the MARC record for Farlow & Brett Surman's The Complete Dinosaur from
|
47
|
+
the Library of Congress.
|
48
|
+
|
49
|
+
|
50
|
+
require 'zoom'
|
51
|
+
|
52
|
+
ZOOM::Connection.open('z3950.loc.gov', 7090) do |conn|
|
53
|
+
conn.database_name = 'Voyager'
|
54
|
+
conn.preferred_record_syntax = 'USMARC'
|
55
|
+
rset = conn.search('@attr 1=7 0253333490')
|
56
|
+
p rset[0]
|
57
|
+
end
|
58
|
+
|
59
|
+
== ZOOM Extended Services
|
60
|
+
|
61
|
+
With release 0.4.1 extended services support has been added which allows
|
62
|
+
create, update and delete of records. This only works for XML.
|
63
|
+
Here's an example adapted from the test suite.
|
64
|
+
|
65
|
+
require 'zoom'
|
66
|
+
|
67
|
+
new_record = File.read('programming_ruby.xml')
|
68
|
+
|
69
|
+
ZOOM::Connection.open('localhost:99999/test') do |conn|
|
70
|
+
p = conn.package
|
71
|
+
p.wait_action = 'waitIfPossible'
|
72
|
+
p.action = 'specialUpdate'
|
73
|
+
p.record = new_record
|
74
|
+
p.send('update')
|
75
|
+
p.send('commit')
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
== Copying
|
48
80
|
|
49
81
|
Copyright (c) 2005 Laurent Sansonetti <lrz@chopine.be>
|
50
82
|
|
@@ -52,7 +84,6 @@ Copying
|
|
52
84
|
You can distribute/modify this program under the terms of
|
53
85
|
the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
|
54
86
|
|
55
|
-
Project Website
|
56
|
-
---------------
|
87
|
+
== Project Website
|
57
88
|
|
58
89
|
http://ruby-zoom.rubyforge.org
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
RUBY_ZOOM_VERSION = '0.4.
|
1
|
+
RUBY_ZOOM_VERSION = '0.4.1'
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
@@ -26,7 +26,13 @@ task :build => [:clean] do |t|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
Rake::TestTask.new('test') do |t|
|
29
|
-
t.pattern = 'test/*_test.rb'
|
29
|
+
t.pattern = ['test/*_test.rb']
|
30
|
+
t.verbose = true
|
31
|
+
t.ruby_opts = ['-r test/unit', '-I src', '-r zoom']
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::TestTask.new('live_test') do |t|
|
35
|
+
t.pattern = 'test/*_live.rb'
|
30
36
|
t.verbose = true
|
31
37
|
t.ruby_opts = ['-r test/unit', '-I src', '-r zoom']
|
32
38
|
end
|
@@ -52,3 +58,8 @@ Rake::GemPackageTask.new(spec) do |pkg|
|
|
52
58
|
pkg.need_zip = true
|
53
59
|
pkg.need_tar = true
|
54
60
|
end
|
61
|
+
|
62
|
+
Rake::RDocTask.new do |rd|
|
63
|
+
rd.main = "README"
|
64
|
+
rd.rdoc_files.include("README", "src/*.c")
|
65
|
+
end
|
data/sample/needle.rb
CHANGED
data/src/rbzoom.c
CHANGED
data/src/rbzoomconnection.c
CHANGED
@@ -18,7 +18,12 @@
|
|
18
18
|
|
19
19
|
#include "rbzoom.h"
|
20
20
|
|
21
|
-
|
21
|
+
#ifdef MAKING_RDOC_HAPPY
|
22
|
+
mZoom = rb_define_module("ZOOM");
|
23
|
+
#endif
|
24
|
+
|
25
|
+
|
26
|
+
/* Document-class: ZOOM::Connection
|
22
27
|
* The Connection object is a session with a target.
|
23
28
|
*/
|
24
29
|
static VALUE cZoomConnection;
|
@@ -71,8 +76,11 @@ void rbz_connection_check(VALUE obj)
|
|
71
76
|
|
72
77
|
|
73
78
|
/*
|
74
|
-
*
|
79
|
+
* call-seq:
|
80
|
+
* open(host, port=nil) { |conn| ... }
|
81
|
+
*
|
75
82
|
* host: hostname of the target to connect to.
|
83
|
+
*
|
76
84
|
* port: network port of the target to connect to.
|
77
85
|
*
|
78
86
|
* A convenience method that creates a new connection and attempts to
|
@@ -109,7 +117,8 @@ rbz_connection_open (int argc, VALUE *argv, VALUE self)
|
|
109
117
|
}
|
110
118
|
|
111
119
|
/*
|
112
|
-
*
|
120
|
+
* call-seq: new(options=nil)
|
121
|
+
*
|
113
122
|
* options: options for the connection, as a Hash object.
|
114
123
|
*
|
115
124
|
* Creates a new connection object, but does not establish a network connection
|
@@ -140,8 +149,11 @@ rbz_connection_new (int argc, VALUE *argv, VALUE self)
|
|
140
149
|
}
|
141
150
|
|
142
151
|
/*
|
143
|
-
*
|
152
|
+
* call-seq:
|
153
|
+
* connect(host, port=nil)
|
154
|
+
*
|
144
155
|
* host: hostname of the target to connect to.
|
156
|
+
*
|
145
157
|
* port: network port of the target to connect to.
|
146
158
|
*
|
147
159
|
* Establishes a network connection to the target specified by the given
|
@@ -176,8 +188,11 @@ rbz_connection_connect (int argc, VALUE *argv, VALUE self)
|
|
176
188
|
}
|
177
189
|
|
178
190
|
/*
|
179
|
-
*
|
191
|
+
* call-seq:
|
192
|
+
* set_option(key, value)
|
193
|
+
*
|
180
194
|
* key: the name of the option, as a string.
|
195
|
+
*
|
181
196
|
* value: the value of this option (as a string, integer or boolean).
|
182
197
|
*
|
183
198
|
* Sets an option on the connection.
|
@@ -199,7 +214,9 @@ rbz_connection_set_option (VALUE self, VALUE key, VALUE val)
|
|
199
214
|
}
|
200
215
|
|
201
216
|
/*
|
202
|
-
*
|
217
|
+
* call-seq:
|
218
|
+
* get_option(key)
|
219
|
+
*
|
203
220
|
* key: the name of the option, as a string.
|
204
221
|
*
|
205
222
|
* Gets the value of a connection's option.
|
@@ -220,7 +237,9 @@ rbz_connection_get_option (VALUE self, VALUE key)
|
|
220
237
|
}
|
221
238
|
|
222
239
|
/*
|
223
|
-
*
|
240
|
+
* call-seq:
|
241
|
+
* search(criterion)
|
242
|
+
*
|
224
243
|
* criterion: the search criterion, either as a ZOOM::Query object or as a string,
|
225
244
|
* representing a PQF query.
|
226
245
|
*
|
@@ -254,14 +273,12 @@ rbz_connection_search (VALUE self, VALUE criterion)
|
|
254
273
|
|
255
274
|
|
256
275
|
/*
|
257
|
-
* Method: package()
|
258
|
-
*
|
259
276
|
* Constructs a new extended services ZOOM::Package using this connections host information.
|
260
277
|
*
|
261
278
|
* Note: The Perl script passes this connections options if already set, otherwise constructs a new ZOOM::Option object.
|
262
279
|
* Currently this method always constructs a new ZOOM::Option object for each package.
|
263
280
|
*
|
264
|
-
* Returns: a new ZOOM::Package object
|
281
|
+
* Returns: a new ZOOM::Package object.
|
265
282
|
*/
|
266
283
|
static VALUE
|
267
284
|
rbz_connection_package(VALUE self)
|