Commit 1f1c8c55 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello

Merge branch 'unreleased-2.0.0' of gitlab.c3sl.ufpr.br:c3sl/dspace-rest-client...

Merge branch 'unreleased-2.0.0' of gitlab.c3sl.ufpr.br:c3sl/dspace-rest-client into unreleased-2.0.0
parents 35b30127 0fd430e7
source 'https://rubygems.org'
gem 'simplecov'
# Specify your gem's dependencies in mark.gemspec
gemspec
......
require "forwardable"
require "json"
require "resource_kit"
require "faraday"
require "active_support"
require_relative "dspace/version"
require_relative "dspace/resources/community_resource"
require_relative "dspace/resources/collection_resource"
require_relative "dspace/resources/authentication_resource"
require_relative "dspace/resources/status_resource"
require_relative "dspace/resources/item_resource"
require_relative "dspace/builders/hash_builder"
require_relative "dspace/builders/model_builder"
......
......@@ -20,11 +20,11 @@ module Dspace
def self.resources
{
items: ItemResource,
collections: CollectionResource,
communities: CommunityResource,
status: StatusResource,
authentication: AuthenticationResource
items: ::Dspace::Resources::ItemResource,
collections: ::Dspace::Resources::CollectionResource,
communities: ::Dspace::Resources::CommunityResource,
status: ::Dspace::Resources::StatusResource,
authentication: ::Dspace::Resources::AuthenticationResource
}
end
......
......@@ -3,6 +3,7 @@ module Dspace
class StatusResource < ResourceKit::Resource
resources do
action :test, 'GET /rest/test' do
handler(200, 201) { |response| true }
end
......@@ -10,8 +11,9 @@ module Dspace
action :status, 'GET /rest/status' do
handler(200) { |response| JSON.parse(response.body) }
end
end
end
end
end
end
\ No newline at end of file
......@@ -8,8 +8,8 @@ RSpec.describe Dspace::Resources::ItemResource, resource_kit: true do
# > GET /items/{item id}/metadata - Return item metadata.
# > GET /items/{item id}/bitstreams - Return item bitstreams. Use the limit parameter to control items per response (default 100) and offset for paging.
# POST /items/find-by-metadata-field - Find items by metadata entry. You must post a MetadataEntry. DS-2501 - wrong SQL in REST /items/find-by-metadata-field CLOSED
# POST /items/{item id}/metadata - Add metadata to item. You must post an array of MetadataEntry
# POST /items/{item id}/bitstreams - Add bitstream to item. You must post a Bitstream
# > POST /items/{item id}/metadata - Add metadata to item. You must post an array of MetadataEntry
# > POST /items/{item id}/bitstreams - Add bitstream to item. You must post a Bitstream
# PUT /items/{item id}/metadata - Update metadata in item. You must put a MetadataEntry
# > DELETE /items/{item id} - Delete item.
# > DELETE /items/{item id}/metadata - Clear item metadata.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment