oai 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/oai/client.rb +3 -2
- data/lib/oai/xpath.rb +10 -5
- metadata +62 -62
data/Rakefile
CHANGED
data/lib/oai/client.rb
CHANGED
@@ -32,8 +32,9 @@ module OAI
|
|
32
32
|
#
|
33
33
|
# client = OAI::Client.new 'http://www.pubmedcentral.gov/oai/oai.cgi'
|
34
34
|
# record = client.get_record :identifier => 'oai:pubmedcentral.gov:13901'
|
35
|
-
# for identifier in client.list_identifiers
|
36
|
-
# puts identifier
|
35
|
+
# for identifier in client.list_identifiers
|
36
|
+
# puts identifier
|
37
|
+
# end
|
37
38
|
#
|
38
39
|
# It is worth noting that the api uses methods and parameter names with
|
39
40
|
# underscores in them rather than studly caps. So above list_identifiers
|
data/lib/oai/xpath.rb
CHANGED
@@ -37,8 +37,13 @@ module OAI
|
|
37
37
|
case node.class.to_s
|
38
38
|
when 'REXML::Element'
|
39
39
|
return node.attribute(attr_name)
|
40
|
-
when 'XML::Node'
|
41
|
-
|
40
|
+
when 'LibXML::XML::Node'
|
41
|
+
#There has been a method shift between 0.5 and 0.7
|
42
|
+
if defined?(node.property) == nil
|
43
|
+
return node.attributes[attr_name]
|
44
|
+
else
|
45
|
+
return node.property(attr_name)
|
46
|
+
end
|
42
47
|
end
|
43
48
|
return nil
|
44
49
|
end
|
@@ -48,11 +53,11 @@ module OAI
|
|
48
53
|
# figure out what sort of object we should do xpath on
|
49
54
|
def parser_type(x)
|
50
55
|
case x.class.to_s
|
51
|
-
when 'XML::Document'
|
56
|
+
when 'LibXML::XML::Document'
|
52
57
|
return 'libxml'
|
53
|
-
when 'XML::Node'
|
58
|
+
when 'LibXML::XML::Node'
|
54
59
|
return 'libxml'
|
55
|
-
when 'XML::Node::Set'
|
60
|
+
when 'LibXML::XML::Node::Set'
|
56
61
|
return 'libxml'
|
57
62
|
when 'REXML::Element'
|
58
63
|
return 'rexml'
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: oai
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2008-
|
6
|
+
version: 0.0.9
|
7
|
+
date: 2008-08-12 00:00:00 -07:00
|
8
8
|
summary: A ruby library for working with the Open Archive Initiative Protocol for Metadata Harvesting (OAI-PMH)
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -32,102 +32,102 @@ files:
|
|
32
32
|
- README
|
33
33
|
- Rakefile
|
34
34
|
- bin/oai
|
35
|
-
- test/activerecord_provider
|
36
|
-
- test/activerecord_provider/config
|
37
|
-
- test/activerecord_provider/config/connection.rb
|
38
|
-
- test/activerecord_provider/config/database.yml
|
39
|
-
- test/activerecord_provider/database
|
40
|
-
- test/activerecord_provider/database/ar_migration.rb
|
41
|
-
- test/activerecord_provider/database/oaipmhtest
|
42
|
-
- test/activerecord_provider/fixtures
|
43
|
-
- test/activerecord_provider/fixtures/dc.yml
|
44
|
-
- test/activerecord_provider/helpers
|
45
|
-
- test/activerecord_provider/helpers/providers.rb
|
46
|
-
- test/activerecord_provider/helpers/set_provider.rb
|
47
|
-
- test/activerecord_provider/models
|
48
|
-
- test/activerecord_provider/models/dc_field.rb
|
49
|
-
- test/activerecord_provider/models/dc_set.rb
|
50
|
-
- test/activerecord_provider/models/oai_token.rb
|
51
|
-
- test/activerecord_provider/tc_ar_provider.rb
|
52
|
-
- test/activerecord_provider/tc_ar_sets_provider.rb
|
53
|
-
- test/activerecord_provider/tc_caching_paging_provider.rb
|
54
|
-
- test/activerecord_provider/tc_simple_paging_provider.rb
|
55
|
-
- test/activerecord_provider/test_helper.rb
|
56
35
|
- test/client
|
57
36
|
- test/client/helpers
|
58
|
-
- test/client/helpers/provider.rb
|
59
37
|
- test/client/helpers/test_wrapper.rb
|
60
|
-
- test/client/
|
61
|
-
- test/client/
|
38
|
+
- test/client/helpers/provider.rb
|
39
|
+
- test/client/tc_list_sets.rb
|
40
|
+
- test/client/tc_list_metadata_formats.rb
|
41
|
+
- test/client/tc_utf8_escaping.rb
|
62
42
|
- test/client/tc_identify.rb
|
63
43
|
- test/client/tc_libxml.rb
|
64
44
|
- test/client/tc_list_identifiers.rb
|
65
|
-
- test/client/
|
66
|
-
- test/client/tc_list_records.rb
|
67
|
-
- test/client/tc_list_sets.rb
|
45
|
+
- test/client/tc_get_record.rb
|
68
46
|
- test/client/tc_low_resolution_dates.rb
|
69
|
-
- test/client/
|
47
|
+
- test/client/tc_list_records.rb
|
70
48
|
- test/client/tc_xpath.rb
|
71
49
|
- test/client/test_helper.rb
|
50
|
+
- test/client/tc_exception.rb
|
51
|
+
- test/activerecord_provider
|
52
|
+
- test/activerecord_provider/tc_ar_provider.rb
|
53
|
+
- test/activerecord_provider/helpers
|
54
|
+
- test/activerecord_provider/helpers/providers.rb
|
55
|
+
- test/activerecord_provider/helpers/set_provider.rb
|
56
|
+
- test/activerecord_provider/models
|
57
|
+
- test/activerecord_provider/models/dc_set.rb
|
58
|
+
- test/activerecord_provider/models/oai_token.rb
|
59
|
+
- test/activerecord_provider/models/dc_field.rb
|
60
|
+
- test/activerecord_provider/tc_simple_paging_provider.rb
|
61
|
+
- test/activerecord_provider/tc_caching_paging_provider.rb
|
62
|
+
- test/activerecord_provider/database
|
63
|
+
- test/activerecord_provider/database/ar_migration.rb
|
64
|
+
- test/activerecord_provider/database/oaipmhtest
|
65
|
+
- test/activerecord_provider/test_helper.rb
|
66
|
+
- test/activerecord_provider/fixtures
|
67
|
+
- test/activerecord_provider/fixtures/dc.yml
|
68
|
+
- test/activerecord_provider/tc_ar_sets_provider.rb
|
69
|
+
- test/activerecord_provider/config
|
70
|
+
- test/activerecord_provider/config/database.yml
|
71
|
+
- test/activerecord_provider/config/connection.rb
|
72
|
+
- test/test.xml
|
72
73
|
- test/provider
|
73
|
-
- test/provider/models.rb
|
74
|
-
- test/provider/tc_exceptions.rb
|
75
|
-
- test/provider/tc_functional_tokens.rb
|
76
74
|
- test/provider/tc_provider.rb
|
77
|
-
- test/provider/
|
75
|
+
- test/provider/tc_functional_tokens.rb
|
78
76
|
- test/provider/tc_simple_provider.rb
|
77
|
+
- test/provider/tc_exceptions.rb
|
78
|
+
- test/provider/tc_resumption_tokens.rb
|
79
79
|
- test/provider/test_helper.rb
|
80
|
-
- test/
|
80
|
+
- test/provider/models.rb
|
81
81
|
- lib/oai
|
82
|
+
- lib/oai/xpath.rb
|
82
83
|
- lib/oai/client
|
83
|
-
- lib/oai/client/get_record.rb
|
84
|
-
- lib/oai/client/header.rb
|
85
84
|
- lib/oai/client/identify.rb
|
86
|
-
- lib/oai/client/
|
87
|
-
- lib/oai/client/list_metadata_formats.rb
|
88
|
-
- lib/oai/client/list_records.rb
|
85
|
+
- lib/oai/client/record.rb
|
89
86
|
- lib/oai/client/list_sets.rb
|
87
|
+
- lib/oai/client/header.rb
|
90
88
|
- lib/oai/client/metadata_format.rb
|
91
|
-
- lib/oai/client/record.rb
|
92
89
|
- lib/oai/client/response.rb
|
93
|
-
- lib/oai/client.rb
|
94
|
-
- lib/oai/
|
90
|
+
- lib/oai/client/list_records.rb
|
91
|
+
- lib/oai/client/get_record.rb
|
92
|
+
- lib/oai/client/list_identifiers.rb
|
93
|
+
- lib/oai/client/list_metadata_formats.rb
|
95
94
|
- lib/oai/exception.rb
|
95
|
+
- lib/oai/constants.rb
|
96
|
+
- lib/oai/set.rb
|
96
97
|
- lib/oai/harvester
|
97
|
-
- lib/oai/harvester/config.rb
|
98
98
|
- lib/oai/harvester/harvest.rb
|
99
|
+
- lib/oai/harvester/config.rb
|
99
100
|
- lib/oai/harvester/logging.rb
|
100
101
|
- lib/oai/harvester/mailer.rb
|
101
102
|
- lib/oai/harvester/shell.rb
|
103
|
+
- lib/oai/client.rb
|
102
104
|
- lib/oai/harvester.rb
|
105
|
+
- lib/oai/provider.rb
|
103
106
|
- lib/oai/provider
|
104
|
-
- lib/oai/provider/
|
105
|
-
- lib/oai/provider/metadata_format
|
106
|
-
- lib/oai/provider/metadata_format/oai_dc.rb
|
107
|
-
- lib/oai/provider/metadata_format.rb
|
108
|
-
- lib/oai/provider/model
|
109
|
-
- lib/oai/provider/model/activerecord_caching_wrapper.rb
|
110
|
-
- lib/oai/provider/model/activerecord_wrapper.rb
|
111
|
-
- lib/oai/provider/model.rb
|
107
|
+
- lib/oai/provider/resumption_token.rb
|
112
108
|
- lib/oai/provider/partial_result.rb
|
109
|
+
- lib/oai/provider/model.rb
|
110
|
+
- lib/oai/provider/metadata_format.rb
|
111
|
+
- lib/oai/provider/response.rb
|
113
112
|
- lib/oai/provider/response
|
113
|
+
- lib/oai/provider/response/identify.rb
|
114
|
+
- lib/oai/provider/response/list_sets.rb
|
115
|
+
- lib/oai/provider/response/record_response.rb
|
114
116
|
- lib/oai/provider/response/error.rb
|
117
|
+
- lib/oai/provider/response/list_records.rb
|
115
118
|
- lib/oai/provider/response/get_record.rb
|
116
|
-
- lib/oai/provider/response/identify.rb
|
117
119
|
- lib/oai/provider/response/list_identifiers.rb
|
118
120
|
- lib/oai/provider/response/list_metadata_formats.rb
|
119
|
-
- lib/oai/provider/
|
120
|
-
- lib/oai/provider/
|
121
|
-
- lib/oai/provider/
|
122
|
-
- lib/oai/provider/
|
123
|
-
- lib/oai/provider/
|
124
|
-
- lib/oai/provider.rb
|
125
|
-
- lib/oai/set.rb
|
126
|
-
- lib/oai/xpath.rb
|
121
|
+
- lib/oai/provider/model
|
122
|
+
- lib/oai/provider/model/activerecord_caching_wrapper.rb
|
123
|
+
- lib/oai/provider/model/activerecord_wrapper.rb
|
124
|
+
- lib/oai/provider/extensions
|
125
|
+
- lib/oai/provider/metadata_format
|
126
|
+
- lib/oai/provider/metadata_format/oai_dc.rb
|
127
127
|
- lib/oai.rb
|
128
128
|
- lib/test.rb
|
129
|
-
- examples/models/file_model.rb
|
130
129
|
- examples/providers/dublin_core.rb
|
130
|
+
- examples/models/file_model.rb
|
131
131
|
test_files: []
|
132
132
|
|
133
133
|
rdoc_options: []
|