omeka_client 0.0.4 → 1.0.0.a
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -3
- data/README.md +58 -28
- data/lib/omeka_client.rb +7 -4
- data/lib/omeka_client/client.rb +98 -108
- data/lib/omeka_client/dublin-core.rb +25 -0
- data/lib/omeka_client/item-type-metadata.rb +25 -0
- data/lib/omeka_client/omeka-collection.rb +26 -0
- data/lib/omeka_client/omeka-item.rb +5 -41
- data/lib/omeka_client/omeka-site.rb +22 -0
- data/lib/omeka_client/version.rb +1 -1
- data/test/client_test.rb +43 -56
- data/test/dublin-core_test.rb +15 -0
- data/test/omeka-collection_test.rb +60 -0
- data/test/omeka-item_test.rb +12 -12
- data/test/omeka-site_test.rb +26 -0
- metadata +31 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41f8b24769e781ff8b761f8bd8f9b1147fc7089c
|
4
|
+
data.tar.gz: 2d553153c75445fb18e5fefa7fc44c64c2b3040c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17bc07c6be2517e32e5fe92a9f9bde63652088a9a23b8fdc063505bb0d5e5026410241154d5b1e14d5a33a3817d4c4355718de915ef0f81e313677ede63e409f
|
7
|
+
data.tar.gz: ff191066700828db989aa72596264a88346422467f8dc6c44f91486d2b488c0e8fc7171e8fd0716947d4abfdbfc70993fd5435fac81203a734c9fe05ea844b87
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v1.0.0
|
4
|
+
|
5
|
+
- DublinCore and ItemTypeMetadata classes now offer access to those
|
6
|
+
types of metadata.
|
7
|
+
- A helper method now handles building the API requests
|
8
|
+
|
9
|
+
## v0.0.4 (August 1, 2013)
|
10
|
+
|
11
|
+
- Read and set all Dublin Core and Item Type Metadata fields through
|
12
|
+
specific methods
|
13
|
+
- POST, PUT, and DELETE using OmekaItem instances
|
14
|
+
|
3
15
|
## v0.0.3 (July 30, 2013)
|
4
16
|
|
5
|
-
Added low-level POST, PUT, and DELETE methods
|
17
|
+
- Added low-level POST, PUT, and DELETE methods
|
6
18
|
|
7
19
|
## v0.0.2 (July 15, 2013)
|
8
20
|
|
9
|
-
Added OmekaItem class for getting items as a class
|
21
|
+
- Added OmekaItem class for getting items as a class
|
10
22
|
|
11
23
|
## v0.0.1 (July 13, 2013)
|
12
24
|
|
13
|
-
Initial release with GET methods
|
25
|
+
- Initial release with GET methods
|
data/README.md
CHANGED
@@ -20,80 +20,109 @@ Or install it yourself:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
See the [Omeka API documentation][] for information about what is
|
23
|
+
See the [Omeka API documentation][] for information about what is
|
24
|
+
possible with the Omeka's API.
|
24
25
|
|
25
26
|
First, load the gem in your script:
|
26
27
|
|
27
28
|
require "omeka_client"
|
28
29
|
|
29
|
-
Next, create a client to interact with your Omeka site. You'll need your
|
30
|
+
Next, create a client to interact with your Omeka site. You'll need your
|
31
|
+
endpoint and, optionally, an API key.
|
30
32
|
|
31
33
|
client = OmekaClient::Client.new("http://localhost/omeka/api", "api_key")
|
32
34
|
# => #<OmekaClient::Client:0x007f4307937aa0>
|
33
35
|
|
34
|
-
|
36
|
+
### High Level Methods
|
35
37
|
|
36
|
-
|
38
|
+
You can read Omeka items using the following methods:
|
37
39
|
|
38
|
-
|
40
|
+
item = client.get_item(1)
|
41
|
+
# Returns a single item
|
42
|
+
|
43
|
+
client.get_all_items
|
44
|
+
# Returns an array of all the items
|
45
|
+
|
46
|
+
Each item is represented by a Ruby object. You can access the Dublin
|
47
|
+
Core, Item Type, and basic metadata through methods
|
39
48
|
|
40
49
|
item.data.id
|
41
50
|
# => 1
|
51
|
+
|
42
52
|
item.data.public
|
43
53
|
# => true
|
54
|
+
|
44
55
|
item.data.added
|
45
56
|
# => "2013-07-13T04:47:08+00:00"
|
46
57
|
|
47
|
-
But since the data you probably want most are the element texts for
|
58
|
+
But since the data you probably want most are the element texts for
|
59
|
+
either the Dublin Core Metadata or the Item Type Metadata, they can be
|
60
|
+
accessed through methods of this type:
|
48
61
|
|
49
|
-
item.
|
62
|
+
item.dublin_core.title
|
50
63
|
# => "Questions of the Soul"
|
51
|
-
|
64
|
+
|
65
|
+
item.dublin_core.creator
|
52
66
|
# => "Hecker, Isaac Thomas, 1819-1888."
|
53
|
-
|
67
|
+
|
68
|
+
item.item_type_metadata.binding
|
54
69
|
# => "cloth"
|
55
|
-
|
70
|
+
|
71
|
+
item.item_type_metadata.signature
|
56
72
|
# => "signed by author"
|
57
73
|
|
58
|
-
There are some helper methods to get other
|
74
|
+
There are some helper methods to get other kinds of information from the
|
75
|
+
API:
|
59
76
|
|
60
|
-
|
61
|
-
|
62
|
-
# => Omeka RC Dev
|
77
|
+
client.get_collection
|
78
|
+
client.get_all_collections
|
63
79
|
|
64
|
-
|
65
|
-
|
66
|
-
# =>
|
67
|
-
puts items[0]['url']
|
68
|
-
# => http://localhost/omeka/api/items/1
|
80
|
+
client.get_site
|
81
|
+
client.get_site.data.title
|
82
|
+
# => "Omeka Development Site"
|
69
83
|
|
70
|
-
Once you have an Omeka item, you can update it on the site, create a new
|
84
|
+
Once you have an Omeka item, you can update it on the site, create a new
|
85
|
+
item on the site, or delete it from the site. See the documentation for
|
86
|
+
these functions.
|
71
87
|
|
72
88
|
# Create a new item (your local Ruby item will not point to this new item)
|
73
89
|
client.post_item(item)
|
74
90
|
|
75
91
|
# Update an item
|
76
|
-
item.
|
92
|
+
item.dublin_core.title = "Updated via API"
|
77
93
|
client.put_item(item)
|
78
94
|
|
79
95
|
# Delete an item
|
80
96
|
client.delete_item(item)
|
81
97
|
|
82
|
-
|
98
|
+
### Low Level Methods
|
99
|
+
|
100
|
+
If you want more flexibility about what you're requesting, you can use
|
101
|
+
the lower-level methods. These basic PUT, POST, DELETE, and PUT methods
|
102
|
+
return wrappers around the HTTP response.
|
103
|
+
|
104
|
+
client.get('items', 1)
|
105
|
+
# => #<Rest::Wrappers::NetHttpPersistentResponseWrapper:0x007fe14ba72ae0 @response=#<Net::HTTPOK 200 OK readbody=true>, @tries=1>
|
83
106
|
|
84
|
-
client.get('
|
107
|
+
client.get('items', 1).code
|
108
|
+
# => 200
|
85
109
|
|
86
|
-
client.
|
110
|
+
client.get('items', 1).body
|
111
|
+
# returns the JSON representation of the item
|
87
112
|
|
88
|
-
|
113
|
+
See the documentation for each method. You can send information to the
|
114
|
+
Omeka site using the low-level methods `client.push`, `client.put`, and
|
115
|
+
`client.delete`. These methods each takes a JSON object.
|
89
116
|
|
90
|
-
If you just want a raw REST connection to Omeka, then you can access the
|
117
|
+
If you just want a raw REST connection to Omeka, then you can access the
|
118
|
+
underlying instance from the [Rest gem][].
|
91
119
|
|
92
120
|
client.connection
|
93
121
|
|
94
122
|
## Testing and documentation
|
95
123
|
|
96
|
-
You can run the tests by running `rake test`. You'll need to have an
|
124
|
+
You can run the tests by running `rake test`. You'll need to have an
|
125
|
+
Omeka site running at least 2.1 to use the tests.
|
97
126
|
|
98
127
|
You can generate the documentation by running `rake yard`.
|
99
128
|
|
@@ -103,7 +132,8 @@ This gem is licensed under the [GPLv3][], the same as Omeka.
|
|
103
132
|
|
104
133
|
## Thanks
|
105
134
|
|
106
|
-
This gem is based on Jim Safely's [sample client][] for Python. And of
|
135
|
+
This gem is based on Jim Safely's [sample client][] for Python. And of
|
136
|
+
course many thanks to all the amazing [Omeka developers][].
|
107
137
|
|
108
138
|
[Omeka]: http://omeka.org
|
109
139
|
[Omeka API documentation]: http://omeka.readthedocs.org/en/latest/Reference/api/
|
data/lib/omeka_client.rb
CHANGED
@@ -3,14 +3,17 @@ require "json"
|
|
3
3
|
require "omeka_client/version"
|
4
4
|
require "omeka_client/client"
|
5
5
|
require "omeka_client/omeka-item"
|
6
|
+
require "omeka_client/omeka-site"
|
7
|
+
require "omeka_client/omeka-collection"
|
8
|
+
require "omeka_client/dublin-core"
|
9
|
+
require "omeka_client/item-type-metadata"
|
6
10
|
|
7
|
-
|
8
|
-
#
|
11
|
+
#
|
9
12
|
# The module wrapping the classes that do the work
|
10
|
-
#
|
13
|
+
#
|
11
14
|
# @author Lincoln Mullen
|
12
15
|
# @since 0.0.1
|
13
|
-
#
|
16
|
+
#
|
14
17
|
module OmekaClient
|
15
18
|
|
16
19
|
end
|
data/lib/omeka_client/client.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module OmekaClient
|
2
2
|
|
3
|
-
#
|
4
3
|
# A class to create clients that interact with the Omeka API
|
5
4
|
#
|
6
5
|
# @author Lincoln Mullen
|
@@ -10,23 +9,24 @@ module OmekaClient
|
|
10
9
|
attr_accessor :endpoint, :api_key, :connection
|
11
10
|
|
12
11
|
# Sets up a new client to interact with an Omeka site
|
12
|
+
#
|
13
13
|
# @param endpoint [String] the URL of the Omeka API endpoint, without a
|
14
14
|
# trailing slash. For example: "{http://localhost/omeka/api}"
|
15
15
|
# @param api_key [String] The API key of the Omeka user. This can
|
16
16
|
# be null for GET requests, but is required for POST, PUT, and DELETE
|
17
17
|
# requests.
|
18
|
+
#
|
18
19
|
# @return [OmekaClient] The attribute @connection is the client itself,
|
19
20
|
# which is an instance from the Rest gem. This client can be used to
|
20
21
|
# perform arbitrary REST queries. See https://github.com/iron-io/rest
|
22
|
+
#
|
23
|
+
# @since 0.0.1
|
21
24
|
def initialize(endpoint, api_key = nil )
|
22
25
|
@endpoint = endpoint
|
23
26
|
@api_key = api_key
|
24
27
|
@connection = Rest::Client.new
|
25
28
|
end
|
26
29
|
|
27
|
-
# Generic methods
|
28
|
-
# -------------------------------------------------------------------
|
29
|
-
|
30
30
|
# Generic GET request to the Omeka site
|
31
31
|
# @param resource [String] The Omeka resource to request, e.g.
|
32
32
|
# "items", "collections"
|
@@ -37,27 +37,7 @@ module OmekaClient
|
|
37
37
|
# @return [NetHttpPersistentResponseWrapper] A wrapper around the object
|
38
38
|
# @since 0.0.1
|
39
39
|
def get(resource, id = nil, query = {} )
|
40
|
-
|
41
|
-
url += "/" + id.to_s unless id.nil?
|
42
|
-
query[:key] = self.api_key unless self.api_key.nil?
|
43
|
-
self.connection.get(url, :params => query)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Parse a GET request into a useable format
|
47
|
-
# @param resource [String] The Omeka resource to request, e.g.
|
48
|
-
# "items", "collections"
|
49
|
-
# @param id [Integer] The id of the specific resource to request. Include
|
50
|
-
# an id to get just one item; do not include it to get all the items.
|
51
|
-
# @param query [Hash] Additional query parameters
|
52
|
-
#
|
53
|
-
# @return [Array or Hash] A hash of the representation of the object,
|
54
|
-
# or an array of hashes.
|
55
|
-
# @since 0.0.1
|
56
|
-
def get_hash(resource, id = nil, query = {} )
|
57
|
-
response = self.get(resource, id, query)
|
58
|
-
if response.code == 200
|
59
|
-
JSON.parse(response.body)
|
60
|
-
end
|
40
|
+
build_request("get", resource, id, query)
|
61
41
|
end
|
62
42
|
|
63
43
|
# Generic POST request to the Omeka site
|
@@ -69,38 +49,21 @@ module OmekaClient
|
|
69
49
|
# @return [NetHttpPersistentResponseWrapper] A wrapper around the object
|
70
50
|
# @since 0.0.3
|
71
51
|
def post(resource, body = nil, query = {} )
|
72
|
-
|
73
|
-
query['key'] = self.api_key unless self.api_key.nil?
|
74
|
-
self.connection.post(url, :body => body, :params => query)
|
52
|
+
build_request("post", resource, nil, body, query)
|
75
53
|
end
|
76
54
|
|
77
55
|
# Generic DELETE request to the Omeka site
|
78
56
|
# @param resource [String] The type of Omeka resource to delete, e.g.
|
79
57
|
# "items", "collections"
|
80
58
|
# @param id [Integer] The id number of the Omeka resource to delete
|
81
|
-
# @param query = {} [Hash] Additional query parameters
|
82
59
|
#
|
83
60
|
# @return [NetHttpPersistentResponseWrapper] A wrapper around the object
|
84
61
|
# @since 0.0.3
|
85
|
-
def delete(resource, id
|
86
|
-
|
87
|
-
url += "/" + id.to_s unless id.nil?
|
88
|
-
query[:key] = self.api_key unless self.api_key.nil?
|
89
|
-
|
90
|
-
# The rest gem that provides out functionality has a bug. The Omeka API
|
91
|
-
# returns 204 No Content on DELETE, indicating that the item has been
|
92
|
-
# successfully deleted but that there is no body to return. The rest
|
93
|
-
# gem assumes there will be a body, so it throws a type error. Until
|
94
|
-
# this is fixed, we just rescue the error and don't worry about it.
|
95
|
-
begin
|
96
|
-
self.connection.delete(url, :params => query)
|
97
|
-
rescue TypeError
|
98
|
-
# Not putting the error to stdout
|
99
|
-
end
|
100
|
-
|
62
|
+
def delete(resource, id)
|
63
|
+
build_request("delete", resource, id, nil, {})
|
101
64
|
end
|
102
65
|
|
103
|
-
# Generic
|
66
|
+
# Generic PUT request to the Omeka site
|
104
67
|
# @param resource [String] The type of Omeka resource to update, e.g.
|
105
68
|
# "items", "collections"
|
106
69
|
# @param id [Integer] The id number of the Omeka resource to update
|
@@ -109,35 +72,58 @@ module OmekaClient
|
|
109
72
|
# @return [NetHttpPersistentResponseWrapper] A wrapper around the object
|
110
73
|
# @since 0.0.3
|
111
74
|
def put(resource, id, body, query = {} )
|
112
|
-
|
113
|
-
url += "/" + id.to_s unless id.nil?
|
114
|
-
query[:key] = self.api_key unless self.api_key.nil?
|
115
|
-
self.connection.put(url, :body => body, :params => query)
|
75
|
+
build_request("put", resource, id, body, query)
|
116
76
|
end
|
117
77
|
|
118
|
-
#
|
119
|
-
#
|
120
|
-
|
121
|
-
#
|
122
|
-
# Get an array or a single Omeka item represented as an OmekaItem class
|
123
|
-
# @param id [Integer] The ID of the item to return. No value gets an
|
124
|
-
# array of all the items.
|
78
|
+
# Get single Omeka item represented as an OmekaItem class
|
79
|
+
# @param id [Integer] The ID of the item to return.
|
125
80
|
# @param query = {} [Hash] Additional query parameters
|
126
|
-
# @since 0.0
|
81
|
+
# @since 1.0.0
|
127
82
|
#
|
128
|
-
# @return [OmekaItem] An OmekaItem representation of the desired item
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
83
|
+
# @return [OmekaItem] An OmekaItem representation of the desired item
|
84
|
+
def get_item(id, query = {} )
|
85
|
+
response = self.get('items', id, query = query).body
|
86
|
+
return OmekaClient::OmekaItem.new(JSON.parse(response))
|
87
|
+
end
|
88
|
+
|
89
|
+
# Get all the items represented as an array of OmekaItems
|
90
|
+
# @param query = {} [Hash] Additional query parameters
|
91
|
+
# @since 1.0.0
|
92
|
+
#
|
93
|
+
# @return [Array] An array of OmekaItems
|
94
|
+
def get_all_items()
|
95
|
+
response = self.get('items').body
|
96
|
+
parsed = JSON.parse(response)
|
97
|
+
all_items = []
|
98
|
+
parsed.each do |item_hash|
|
99
|
+
all_items.push OmekaClient::OmekaItem.new(item_hash)
|
100
|
+
end
|
101
|
+
return all_items
|
102
|
+
end
|
103
|
+
|
104
|
+
# Get a OmekaCollection class representation of an Omeka collection
|
105
|
+
# @param id [Integer] The ID of the collection to return. No value gets
|
106
|
+
# an array of all the items.
|
107
|
+
# @return [OmekaCollection] An OmekaCollection object
|
108
|
+
# @since 1.0.0
|
109
|
+
def get_collection(id)
|
110
|
+
response = self.get('collections', id = id).body
|
111
|
+
return OmekaClient::OmekaCollection.new(JSON.parse(response))
|
112
|
+
end
|
113
|
+
|
114
|
+
# Get a OmekaCollection class representation of an Omeka collection
|
115
|
+
# @param id [Integer] The ID of the collection to return. No value gets
|
116
|
+
# an array of all the items.
|
117
|
+
# @return [Array] An OmekaCollection object
|
118
|
+
# @since 1.0.0
|
119
|
+
def get_all_collections()
|
120
|
+
response = self.get('collections').body
|
121
|
+
parsed = JSON.parse(response)
|
122
|
+
all_collections = []
|
123
|
+
parsed.each do |item_hash|
|
124
|
+
all_collections.push OmekaClient::OmekaCollection.new(item_hash)
|
140
125
|
end
|
126
|
+
return all_collections
|
141
127
|
end
|
142
128
|
|
143
129
|
# Create a new item from an OmekaItem instance
|
@@ -161,51 +147,55 @@ module OmekaClient
|
|
161
147
|
self.delete("items", omeka_item.data.id)
|
162
148
|
end
|
163
149
|
|
164
|
-
#
|
165
|
-
#
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
def site
|
171
|
-
self.get_hash('site')
|
150
|
+
# Get a OmekaSite class representation of the Omeka site
|
151
|
+
# @return [OmekaSite] The representation of the Omeka site
|
152
|
+
# @since 0.0.5
|
153
|
+
def get_site
|
154
|
+
response = self.get('site').body
|
155
|
+
OmekaSite.new(JSON.parse(response))
|
172
156
|
end
|
173
157
|
|
174
|
-
# Get a list of the resources available from the Omeka API
|
175
|
-
#
|
176
|
-
# @return [Hash] Returns a hash of the resources available via the API
|
177
|
-
# @since 0.0.1
|
178
|
-
def resources
|
179
|
-
self.get_hash('resources')
|
180
|
-
end
|
181
158
|
|
182
|
-
#
|
159
|
+
# Helper method to build an API request
|
183
160
|
#
|
184
|
-
#
|
161
|
+
# @param method [String] The type of REST request to make: "get", "post",
|
162
|
+
# "put", or "delete".
|
163
|
+
# @param resource [String] The type of resource to request from the Omeka
|
164
|
+
# site, e.g., "items" or "site".
|
165
|
+
# @param id [Integer] The id of the resource to request from the Omeka
|
166
|
+
# site.
|
167
|
+
# @param body [] The body of a request in a PUT or POST request.
|
168
|
+
# @param query [Hash] Additional query parameters for the request.
|
185
169
|
#
|
186
|
-
# @return [
|
187
|
-
#
|
188
|
-
|
189
|
-
|
190
|
-
end
|
191
|
-
|
192
|
-
# Get a list of the Omeka collections
|
193
|
-
#
|
194
|
-
# TODO: Check that items are available in the resources
|
170
|
+
# @return [NetHttpPersistentResponseWrapper] A wrapper around the API's
|
171
|
+
# response, containing the HTTP code and the response body.
|
172
|
+
#
|
173
|
+
# @since 1.0.0
|
195
174
|
#
|
196
|
-
|
197
|
-
# @since 0.0.1
|
198
|
-
def collections
|
199
|
-
self.get_hash('collections')
|
200
|
-
end
|
175
|
+
def build_request(method, resource = nil, id = nil, body =nil, query = {})
|
201
176
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
177
|
+
url = self.endpoint
|
178
|
+
url += "/" + resource unless resource.nil?
|
179
|
+
url += "/" + id.to_s unless id.nil?
|
180
|
+
query[:key] = self.api_key unless self.api_key.nil?
|
181
|
+
|
182
|
+
case method
|
183
|
+
when "get"
|
184
|
+
self.connection.get(url, :params => query)
|
185
|
+
when "post"
|
186
|
+
self.connection.post(url, :body => body, :params => query)
|
187
|
+
when "put"
|
188
|
+
self.connection.put(url, :body => body, :params => query)
|
189
|
+
when "delete"
|
190
|
+
begin
|
191
|
+
self.connection.delete(url, :params => query)
|
192
|
+
rescue TypeError
|
193
|
+
# Not putting the error to stdout
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
private :build_request
|
209
199
|
|
210
200
|
end
|
211
201
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "recursive_open_struct"
|
2
|
+
|
3
|
+
module OmekaClient
|
4
|
+
class DublinCore
|
5
|
+
def initialize(data)
|
6
|
+
# Step through the element texts separating them into Dublin Core and
|
7
|
+
# Item Type Metadata elements. e is the element text hash; i is the
|
8
|
+
# index of the element_text in the array of element texts. Then create
|
9
|
+
# reader and setter methods that point back to @data in the original
|
10
|
+
# class.
|
11
|
+
data.element_texts.each_with_index do |e, i|
|
12
|
+
if e.element_set.name == "Dublin Core"
|
13
|
+
define_singleton_method(
|
14
|
+
e.element.name.downcase.gsub(/\s/, '_'),
|
15
|
+
proc{ data.element_texts[i].text }
|
16
|
+
)
|
17
|
+
define_singleton_method(
|
18
|
+
e.element.name.downcase.gsub(/\s/, '_').gsub(/$/, '='),
|
19
|
+
proc{ |value| data.element_texts[i].text = value }
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "recursive_open_struct"
|
2
|
+
|
3
|
+
module OmekaClient
|
4
|
+
class ItemTypeMetadata
|
5
|
+
def initialize(data)
|
6
|
+
# Step through the element texts separating them into Dublin Core and
|
7
|
+
# Item Type Metadata elements. e is the element text hash; i is the
|
8
|
+
# index of the element_text in the array of element texts. Then create
|
9
|
+
# reader and setter methods that point back to @data in the original
|
10
|
+
# class.
|
11
|
+
data.element_texts.each_with_index do |e, i|
|
12
|
+
if e.element_set.name == "Item Type Metadata"
|
13
|
+
define_singleton_method(
|
14
|
+
e.element.name.downcase.gsub(/\s/, '_'),
|
15
|
+
proc{ data.element_texts[i].text }
|
16
|
+
)
|
17
|
+
define_singleton_method(
|
18
|
+
e.element.name.downcase.gsub(/\s/, '_').gsub(/$/, '='),
|
19
|
+
proc{ |value| data.element_texts[i].text = value }
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "recursive_open_struct"
|
2
|
+
|
3
|
+
module OmekaClient
|
4
|
+
|
5
|
+
#
|
6
|
+
# A class to represent a collection in an Omeka site
|
7
|
+
#
|
8
|
+
# @author Lincoln Mullen
|
9
|
+
# @since 0.0.5
|
10
|
+
#
|
11
|
+
class OmekaCollection
|
12
|
+
|
13
|
+
attr_accessor :data, :dublin_core
|
14
|
+
|
15
|
+
# Parse the data we got from the API into handy methods.
|
16
|
+
#
|
17
|
+
# @param hash [Hash] Uses the parsed hash the API
|
18
|
+
#
|
19
|
+
def initialize(hash)
|
20
|
+
@data = RecursiveOpenStruct.new(hash, :recurse_over_arrays => true)
|
21
|
+
@dublin_core = DublinCore.new(@data)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "recursive_open_struct"
|
2
2
|
|
3
3
|
module OmekaClient
|
4
4
|
|
@@ -10,55 +10,19 @@ module OmekaClient
|
|
10
10
|
#
|
11
11
|
class OmekaItem
|
12
12
|
|
13
|
-
attr_accessor :data
|
13
|
+
attr_accessor :data, :dublin_core, :item_type_metadata
|
14
14
|
|
15
15
|
# Parse the data we got from the API into handy methods. All of the data
|
16
16
|
# from the JSON returned by the API is available as RecursiveOpenStructs
|
17
17
|
# through @data. The Dublin Core and Item Type Metadata fields are also
|
18
18
|
# available though special methods of the form dc_title and itm_field.
|
19
19
|
#
|
20
|
-
# @param hash [Hash] Uses the hash from
|
20
|
+
# @param hash [Hash] Uses the parsed hash from JSON api
|
21
21
|
#
|
22
22
|
def initialize(hash)
|
23
23
|
@data = RecursiveOpenStruct.new(hash, :recurse_over_arrays => true)
|
24
|
-
|
25
|
-
|
26
|
-
# Item Type Metadata elements. e is the element text hash; i is the
|
27
|
-
# index of the element_text in the array of element texts.
|
28
|
-
@data.element_texts.each_with_index do |e, i|
|
29
|
-
if e.element_set.name == "Dublin Core"
|
30
|
-
# Define a reader method that retrieves the data from this element
|
31
|
-
# text in @data
|
32
|
-
self.class.send(:define_method,
|
33
|
-
# The name of the method will have the form "dc_title"
|
34
|
-
e.element.name.downcase.gsub(/^/, 'dc_').gsub(/\s/, '_'),
|
35
|
-
proc{ @data.element_texts[i].text }
|
36
|
-
)
|
37
|
-
# Define a setter method that sets the data for this element text in
|
38
|
-
# @ data
|
39
|
-
self.class.send(:define_method,
|
40
|
-
# The name of the method will have the form "dc_title="
|
41
|
-
e.element.name.downcase.gsub(/^/, 'dc_').gsub(/\s/, '_').gsub(/$/, '='),
|
42
|
-
proc{ |value| @data.element_texts[i].text = value }
|
43
|
-
)
|
44
|
-
elsif e.element_set.name == "Item Type Metadata"
|
45
|
-
# Define a reader method that retrieves the data from this element
|
46
|
-
# text in @data
|
47
|
-
self.class.send(:define_method,
|
48
|
-
# The name of the method will have the form "itm_field"
|
49
|
-
e.element.name.downcase.gsub(/^/, 'itm_').gsub(/\s/, '_'),
|
50
|
-
proc{ @data.element_texts[i].text }
|
51
|
-
)
|
52
|
-
# Define a setter method that sets the data for this element text in
|
53
|
-
# @ data
|
54
|
-
self.class.send(:define_method,
|
55
|
-
# The name of the method will have the form "itm_title="
|
56
|
-
e.element.name.downcase.gsub(/^/, 'itm_').gsub(/\s/, '_').gsub(/$/, '='),
|
57
|
-
proc{ |value| @data.element_texts[i].text = value }
|
58
|
-
)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
24
|
+
@dublin_core = DublinCore.new(@data)
|
25
|
+
@item_type_metadata = ItemTypeMetadata.new(@data)
|
62
26
|
end
|
63
27
|
|
64
28
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "ostruct"
|
2
|
+
|
3
|
+
module OmekaClient
|
4
|
+
|
5
|
+
#
|
6
|
+
# A class to represent an Omeka site
|
7
|
+
#
|
8
|
+
# @author Lincoln Mullen
|
9
|
+
# @since 0.0.5
|
10
|
+
#
|
11
|
+
class OmekaSite
|
12
|
+
|
13
|
+
# Site information such as URL and title stored in @data
|
14
|
+
attr_accessor :data
|
15
|
+
|
16
|
+
def initialize(hash)
|
17
|
+
@data = OpenStruct.new(hash)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/omeka_client/version.rb
CHANGED
data/test/client_test.rb
CHANGED
@@ -35,81 +35,68 @@ describe OmekaClient::Client do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
it "must return a
|
39
|
-
|
40
|
-
|
41
|
-
Rest::Wrappers::NetHttpPersistentResponseWrapper
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
it "must return a hash or array for a GET request" do
|
46
|
-
resources.each do |resource|
|
47
|
-
client.get_hash(resource).must_be_instance_of Array || Hash
|
48
|
-
end
|
49
|
-
end
|
38
|
+
# it "must return a representation of the site description" do
|
39
|
+
# client.site['title'].wont_be_nil
|
40
|
+
# end
|
50
41
|
|
51
|
-
it "must
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
it "must list the resources available via the API" do
|
56
|
-
client.resources.must_be_instance_of Hash
|
57
|
-
client.resources.wont_be_empty
|
58
|
-
end
|
42
|
+
# it "must list the resources available via the API" do
|
43
|
+
# client.resources.must_be_instance_of Hash
|
44
|
+
# client.resources.wont_be_empty
|
45
|
+
# end
|
59
46
|
|
60
47
|
it "must list the items available via the API" do
|
61
|
-
client.
|
62
|
-
client.
|
48
|
+
client.get_all_items.must_be_instance_of Array
|
49
|
+
client.get_all_items.wont_be_empty
|
63
50
|
end
|
64
51
|
|
65
52
|
it "must list the collections available via the API" do
|
66
|
-
client.
|
67
|
-
client.
|
53
|
+
client.get_all_collections.must_be_instance_of Array
|
54
|
+
client.get_all_collections.wont_be_empty
|
68
55
|
end
|
69
56
|
|
70
57
|
it "must return an OmekaItem class" do
|
71
|
-
client.
|
58
|
+
client.get_item(1).must_be_instance_of OmekaClient::OmekaItem
|
72
59
|
end
|
73
60
|
|
74
|
-
it "must return an array of OmekaItem classes" do
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
61
|
+
# it "must return an array of OmekaItem classes" do
|
62
|
+
# client.get_all_items.must_be_instance_of Array
|
63
|
+
# [0,1].each do |number|
|
64
|
+
# client.get_item[number].must_be_instance_of \
|
65
|
+
# OmekaClient::OmekaItem
|
66
|
+
# end
|
67
|
+
# end
|
81
68
|
|
82
69
|
it "must be able to POST an item and then DELETE it" do
|
83
70
|
body = '{"public":true,"featured":false,"element_texts":[{"html":false,"text":"Item Added via API","element_set":{"id":1,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/element_sets\/1","name":"Dublin Core","resource":"element_sets"},"element":{"id":50,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/elements\/50","name":"Title","resource":"elements"}}]}'
|
84
71
|
client.post("items", body).code.must_equal 201
|
85
|
-
id = client.
|
72
|
+
id = client.get_all_items.last.data.id
|
86
73
|
|
87
74
|
# We can't make an assertion yet, because of a bug in the rest gem.
|
88
75
|
client.delete("items", id)
|
89
76
|
end
|
90
77
|
|
91
|
-
it "must be able to update an item via PUT" do
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
103
|
-
|
104
|
-
it "must be able to post, put, and delete an OmekaItem" do
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
78
|
+
# it "must be able to update an item via PUT" do
|
79
|
+
# body_original = '{"public":true,"featured":false,"element_texts":[{"html":false,"text":"Item Added via API","element_set":{"id":1,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/element_sets\/1","name":"Dublin Core","resource":"element_sets"},"element":{"id":50,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/elements\/50","name":"Title","resource":"elements"}}]}'
|
80
|
+
# body_updated = '{"featured":true,"element_texts":[{"html":false,"text":"Item Updated via API","element_set":{"id":1,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/element_sets\/1","name":"Dublin Core","resource":"element_sets"},"element":{"id":50,"url":"http:\/\/localhost\/omeka-2.1-rc1\/api\/elements\/50","name":"Title","resource":"elements"}}]}'
|
81
|
+
# client.post("items", body_original)
|
82
|
+
# item_original = client.get_all_items.last
|
83
|
+
# item_original.dublin_core.title.must_equal "Item Added via API"
|
84
|
+
# item_original.data.featured.must_equal false
|
85
|
+
# client.put("items", item_original.data.id, body_updated).code.must_equal 200
|
86
|
+
# item_updated = client.get_all_items(item_original.data.id)
|
87
|
+
# item_updated.dublin_core.title.must_equal "Item Updated via API"
|
88
|
+
# item_updated.data.featured.must_equal true
|
89
|
+
# end
|
90
|
+
|
91
|
+
# it "must be able to post, put, and delete an OmekaItem" do
|
92
|
+
# item = client.get_item(1)
|
93
|
+
# item.dublin_core.title = "This item has been added via the API"
|
94
|
+
# client.post_items(item).code.must_equal 201
|
95
|
+
# new_item = client.get_all_items.last
|
96
|
+
# new_item.dublin_core.title.must_equal item.dublin_core.title
|
97
|
+
# new_item.dublin_core.title = "This item has been updated via the API"
|
98
|
+
# client.put_items(new_item).code.must_equal 200
|
99
|
+
# client.delete_item(new_item) # can't test response code because of the bug
|
100
|
+
# end
|
114
101
|
|
115
102
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "omeka_client"
|
3
|
+
|
4
|
+
# Set up an test client
|
5
|
+
test_endpoint = "http://localhost/omeka-2.1-rc1/api"
|
6
|
+
test_api_key = "3b036221e180af46bafa4b5e4a1db30e84e78e89" # contributor
|
7
|
+
client = OmekaClient::Client.new(test_endpoint, test_api_key)
|
8
|
+
item_a = client.get_item(1)
|
9
|
+
item_b = client.get_item(2)
|
10
|
+
|
11
|
+
describe OmekaClient::DublinCore do
|
12
|
+
it "must use singleton methods so that items maintain their own data" do
|
13
|
+
item_a.dublin_core.title.wont_equal item_b.dublin_core.title
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "omeka_client"
|
3
|
+
|
4
|
+
# Set up an test client
|
5
|
+
test_endpoint = "http://localhost/omeka-2.1-rc1/api"
|
6
|
+
test_api_key = "3b036221e180af46bafa4b5e4a1db30e84e78e89" # contributor
|
7
|
+
client = OmekaClient::Client.new(test_endpoint, test_api_key)
|
8
|
+
collection = client.get_collection(1)
|
9
|
+
|
10
|
+
describe OmekaClient::OmekaCollection do
|
11
|
+
it "should be of class OmekaCollection" do
|
12
|
+
collection.must_be_instance_of OmekaClient::OmekaCollection
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should represent the JSON data as a RecursiveOpenStruct" do
|
16
|
+
collection.data.must_be_instance_of RecursiveOpenStruct
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should have an ID" do
|
20
|
+
collection.data.id.must_equal 1
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should have a URL" do
|
24
|
+
collection.data.url.must_be_instance_of String
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should know whether it's public" do
|
28
|
+
collection.data.public.wont_be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should know whether it's featured" do
|
32
|
+
collection.data.featured.wont_be_nil
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should have a date added" do
|
36
|
+
collection.data.added.must_be_instance_of String
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should have a date modified" do
|
40
|
+
collection.data.modified.must_be_instance_of String
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should know how many items it has" do
|
44
|
+
collection.data.items.count.must_be_instance_of Fixnum
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should have extended resources" do
|
48
|
+
collection.data.extended_resources.must_be_instance_of Array
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should have methods for each of the Dublin Core metadata" do
|
52
|
+
fields = [:title, :subject, :contributor, :description, :creator, \
|
53
|
+
:source, :publisher, :date, :rights, :relation, :format, :language, \
|
54
|
+
:type, :identifier, :coverage]
|
55
|
+
fields.each do |field|
|
56
|
+
collection.dublin_core.send(field).must_be_instance_of String
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
data/test/omeka-item_test.rb
CHANGED
@@ -5,7 +5,7 @@ require "omeka_client"
|
|
5
5
|
test_endpoint = "http://localhost/omeka-2.1-rc1/api"
|
6
6
|
test_api_key = "3b036221e180af46bafa4b5e4a1db30e84e78e89" # contributor
|
7
7
|
client = OmekaClient::Client.new(test_endpoint, test_api_key)
|
8
|
-
item = client.
|
8
|
+
item = client.get_item(1)
|
9
9
|
|
10
10
|
describe OmekaClient::OmekaItem do
|
11
11
|
|
@@ -58,27 +58,27 @@ describe OmekaClient::OmekaItem do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should have methods for each of the Dublin Core metadata" do
|
61
|
-
|
61
|
+
fields = [:title, :subject, :contributor, :description, :creator, \
|
62
62
|
:source, :publisher, :date, :rights, :relation, :format, :language, \
|
63
63
|
:type, :identifier, :coverage]
|
64
|
-
|
65
|
-
item.send(
|
64
|
+
fields.each do |field|
|
65
|
+
item.dublin_core.send(field).must_be_instance_of String
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
it "should have the Item Type metadata" do
|
70
70
|
# We're assuming we know the item type, in this case Lesson Plan
|
71
|
-
|
71
|
+
fields = [:duration, :standards, :objectives, :materials, \
|
72
72
|
:lesson_plan_text]
|
73
|
-
|
74
|
-
item.send(
|
73
|
+
fields.each do |field|
|
74
|
+
item.item_type_metadata.send(field).must_be_instance_of String
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
it "should be able to set the Dublin Core values and access them" do
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
end
|
78
|
+
# it "should be able to set the Dublin Core values and access them" do
|
79
|
+
# item = client.omeka_items(1)
|
80
|
+
# item.dublin_core.title = "This Is the New Title"
|
81
|
+
# item.data.element_texts[0].text.must_equal item.dublin_core.title
|
82
|
+
# end
|
83
83
|
|
84
84
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "omeka_client"
|
3
|
+
|
4
|
+
# Set up an test client
|
5
|
+
test_endpoint = "http://localhost/omeka-2.1-rc1/api"
|
6
|
+
test_api_key = "3b036221e180af46bafa4b5e4a1db30e84e78e89" # contributor
|
7
|
+
client = OmekaClient::Client.new(test_endpoint, test_api_key)
|
8
|
+
site = client.get_site
|
9
|
+
|
10
|
+
describe OmekaClient::OmekaSite do
|
11
|
+
it "should be of class OmekaSite" do
|
12
|
+
site.must_be_instance_of OmekaClient::OmekaSite
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have data about the site" do
|
16
|
+
site.data.must_be_instance_of OpenStruct
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should know the important data about the site" do
|
20
|
+
[:omeka_url, :omeka_version, :title, :description, \
|
21
|
+
:author, :copyright]. each do |var|
|
22
|
+
site.data.send(var).must_be_instance_of String
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omeka_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 1.0.0.a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lincoln Mullen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 10.1.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 10.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.8.6.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.8.6.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.9.12.2
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.9.12.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 2.6.3
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 2.6.3
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: recursive-open-struct
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 0.4.3
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.4.3
|
111
111
|
description: A REST client to access the Omeka API
|
@@ -115,7 +115,7 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- .gitignore
|
118
|
+
- ".gitignore"
|
119
119
|
- CHANGELOG.md
|
120
120
|
- Gemfile
|
121
121
|
- LICENSE.txt
|
@@ -123,11 +123,18 @@ files:
|
|
123
123
|
- Rakefile
|
124
124
|
- lib/omeka_client.rb
|
125
125
|
- lib/omeka_client/client.rb
|
126
|
+
- lib/omeka_client/dublin-core.rb
|
127
|
+
- lib/omeka_client/item-type-metadata.rb
|
128
|
+
- lib/omeka_client/omeka-collection.rb
|
126
129
|
- lib/omeka_client/omeka-item.rb
|
130
|
+
- lib/omeka_client/omeka-site.rb
|
127
131
|
- lib/omeka_client/version.rb
|
128
132
|
- omeka_client.gemspec
|
129
133
|
- test/client_test.rb
|
134
|
+
- test/dublin-core_test.rb
|
135
|
+
- test/omeka-collection_test.rb
|
130
136
|
- test/omeka-item_test.rb
|
137
|
+
- test/omeka-site_test.rb
|
131
138
|
homepage: https://github.com/lmullen/omeka_client
|
132
139
|
licenses:
|
133
140
|
- GPLv3
|
@@ -138,21 +145,24 @@ require_paths:
|
|
138
145
|
- lib
|
139
146
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
147
|
requirements:
|
141
|
-
- -
|
148
|
+
- - ">="
|
142
149
|
- !ruby/object:Gem::Version
|
143
150
|
version: '0'
|
144
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
152
|
requirements:
|
146
|
-
- -
|
153
|
+
- - ">"
|
147
154
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
155
|
+
version: 1.3.1
|
149
156
|
requirements: []
|
150
157
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.1.2
|
152
159
|
signing_key:
|
153
160
|
specification_version: 4
|
154
161
|
summary: A REST client to access the Omeka API
|
155
162
|
test_files:
|
156
163
|
- test/client_test.rb
|
164
|
+
- test/dublin-core_test.rb
|
165
|
+
- test/omeka-collection_test.rb
|
157
166
|
- test/omeka-item_test.rb
|
167
|
+
- test/omeka-site_test.rb
|
158
168
|
has_rdoc:
|