@@ -2,16 +2,16 @@ ruby-oai
2
2
========
3
3
4
4
ruby-oai is a Open Archives Protocol for Metadata Harvesting (OAI-PMH)
5
- library for Ruby. [ OAI-PMH] ( http://openarchives.org ) is a somewhat
6
- archaic protocol for sharing metadata between digital library repositories.
5
+ library for Ruby. [ OAI-PMH] ( http://openarchives.org ) is a somewhat
6
+ archaic protocol for sharing metadata between digital library repositories.
7
7
If you are looking to share metadata on the web you are probably better off
8
- using a feed format like [ RSS] ( http://www.rssboard.org/rss-specification ) or
9
- [ Atom] ( http://www.atomenabled.org/ ) . If have to work with a backwards
10
- digital repository that only offers OAI-PMH access then ruby-oai is your
8
+ using a feed format like [ RSS] ( http://www.rssboard.org/rss-specification ) or
9
+ [ Atom] ( http://www.atomenabled.org/ ) . If have to work with a backwards
10
+ digital repository that only offers OAI-PMH access then ruby-oai is your
11
11
friend.
12
12
13
- The [ OAI-PMH] ( http://openarchives.org ) spec defines six verbs
14
- (` Identify ` , ` ListIdentifiers ` , ` ListRecords ` ,
13
+ The [ OAI-PMH] ( http://openarchives.org ) spec defines six verbs
14
+ (` Identify ` , ` ListIdentifiers ` , ` ListRecords ` ,
15
15
` GetRecords ` , ` ListSets ` , ` ListMetadataFormat ` ) used for discovery and sharing of
16
16
metadata.
17
17
@@ -21,15 +21,15 @@ a interactive harvesting shell.
21
21
Client
22
22
------
23
23
24
- The OAI client library is used for harvesting metadata from repositories.
24
+ The OAI client library is used for harvesting metadata from repositories.
25
25
For example to initiate a ListRecords request to pubmed you can:
26
26
27
27
``` ruby
28
28
require ' oai'
29
29
client
= OAI ::
Client .
new ' http://www.pubmedcentral.gov/oai/oai.cgi' ,
:headers => {
" From" =>
" [email protected] " }
30
30
response = client.list_records
31
31
# Get the first page of records
32
- response.each do |record |
32
+ response.each do |record |
33
33
puts record.metadata
34
34
end
35
35
# Get the second page of records
@@ -81,6 +81,15 @@ Alternately it can be installed globally using RubyGems:
81
81
82
82
$ gem install oai
83
83
84
+ Running tests
85
+ -------------
86
+
87
+ Tests are with Test::Unit, in a somewhat archaic/legacy style. Test setup especially is not how we would do things today. Run all tests with:
88
+
89
+ $ bundle exec rake test
90
+
91
+ There are also convenience tasks to run subsets of tests.
92
+
84
93
License
85
94
-------
86
95
0 commit comments