modify all gem structure to add tests and binary files

parent 56363fe7
\ No newline at end of file
language: ruby
- 2.2.0
before_install: gem install bundler -v 1.10.6
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](, version 1.0.0, available at [](
source ''
# Specify your gem's dependencies in mark.gemspec
# Copyright (C) 2004-2008 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
# dspace-rest-client is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# DSpace REST Client
# Mark
DSpace REST Client is a ruby gem that integrates DSpace servers with your application.
For now, the gem is under development, so some features are missing.
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mark`. To experiment with that code, run `bin/console` for an interactive prompt.
## Example of use:
TODO: Delete this and the text above, and describe your gem
## Installation
Add this line to your application's Gemfile:
require 'dspace-rest-client'
gem 'mark'
client ='')
client.login '', 'dspace'
And then execute:
# check the status after authentication
puts client.status
$ bundle
List communities
Or install it yourself as:
require 'dspace-rest-client'
$ gem install mark
client ='')
community_repository = client.repository.community_repository
all_communities = community_repository.get_all_communities
## Usage
all_communities.each do |c|
TODO: Write usage instructions here
#### Bitstreams features:
- √ GET /bitstreams - Return all bitstreams in DSpace.
- √ GET /bitstreams/{bitstream id} - Return bitstream.
- GET /bitstreams/{bitstream id}/policy - Return bitstream policies.
- √ GET /bitstreams/{bitstream id}/retrieve - Return data of bitstream.
- POST /bitstreams/{bitstream id}/policy - Add policy to item. You must post a ResourcePolicy
- PUT /bitstreams/{bitstream id}/data - Update data/file of bitstream. You must put the data
- √ PUT /bitstreams/{bitstream id} - Update metadata of bitstream. You must put a Bitstream, does not alter the file/data
- DELETE /bitstreams/{bitstream id} - Delete bitstream from DSpace.
- DELETE /bitstreams/{bitstream id}/policy/{policy_id} - Delete bitstream policy.
#### Collections features:
- √ GET /communities/{communityId}/collections - Returns array of collections of community.
- √ GET /collections - Return all collections of DSpace in array.
- √ GET /collections/{collectionId} - Return collection with id.
- √ GET /collections/{collectionId}/items - Return all items of collection.
- √ POST /communities/{communityId}/collections - Create new collections in community. You must post Collection.
- √ POST /collections/{collectionId}/items - Create posted item in collection. You must post an Item
- POST /collections/find-collection - Find collection by passed name.
- PUT /collections/{collectionId} - Update collection. You must put Collection.
- DELETE /collections/{collectionId} - Delete collection from DSpace.
- DELETE /collections/{collectionId}/items/{itemId} - Delete item in collection.
- DELETE /communities/{communityId}/collections/{collectionId} - Delete collection in community.
#### Community features:
- √ GET /communities - Returns array of all communities in DSpace.
- √ GET /communities/top-communities - Returns array of all top communities in DSpace
- √ GET /communities/{communityId} - Returns community
- √ GET /communities/{communityId}/communities - Returns array of subcommunities of community.
- √ POST /communities - Create new community at top level. You must post community.
- √ POST /communities/{communityId}/communities - Create new subcommunity in community. You must post Community.
- PUT /communities/{communityId} - Update community. You must put Community
- DELETE /communities/{communityId} - Delete community.
- DELETE /communities/{communityId}/communities/{communityId2} - Delete subcommunity in community.
#### Item features:
- √ GET /items - Return list of items.
- √ GET /items/{item id} - Return item.
- √ GET /items/{item id}/metadata - Return item metadata.
- √ GET /items/{item id}/bitstreams - Return item bitstreams.
- 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
- √ 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.
- DELETE /items/{item id}/bitstreams/{bitstream id} - Delete item bitstream.
### Version
### Contributors
> - Mauricio Giacomini Girardello <>
> - Bruno Zanette <>
### Installation
You need compile the gem:
$ gem build dspace-rest-client.gemspec
## Development
To install:
gem install --local dspace-rest-client-1.0.0.gem
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
### Development
Want to contribute? Great!
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [](
## Contributing
Bug reports and pull requests are welcome on GitHub at[USERNAME]/mark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant]( code of conduct.
**Free Software, Hell Yeah!**
\ No newline at end of file
require "bundler/gem_tasks"
require "rake/testtask" do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
task :default => :test
module Dspace
#the current dspace-rest-client version
VERSION = '2.0.0'
\ No newline at end of file
#!/usr/bin/env ruby
require "bundler/setup"
require "dspace"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
set -euo pipefail
bundle install
# Do any other automated setup that you need to do here
:rubygems_api_key: cfa0bd29364baee94fbf1ab847955136 do |s| = 'dspace_rest_client'
s.version = '2.0.0' = '2015-05-22'
s.summary = "DSpace REST API Client for Ruby!"
s.description = "DSpace REST-API Client for Ruby! Implements all DSpace REST-API endpoints requests."
s.authors = ["Mauricio Giacomini Girardello", "Bruno N. Zanette", "Mateus Rambo Strey"] = ''
s.files = `git ls-files -z`.split("\0")
s.test_files = `git ls-files -z test/`.split("\0")
s.homepage = ''
s.license = 'GNU General Public License'
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dspace/version' do |spec| = '2015-11-23' = "dspace_rest_client"
spec.version = Dspace::VERSION
spec.authors = ["Mauricio Giacomini Girardello", "Lucas Ernesto Kindinger", "Bruno N. Zanette", "Mateus Rambo Strey"] = ["", ""]
spec.summary = 'DSpace REST API Client for Ruby'
spec.description = 'DSpace REST-API Client for Ruby! Implements all DSpace REST-API endpoints requests.'
spec.homepage = ''
spec.license = 'GNU - General Public License'
# Prevent pushing this gem to by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to ''"
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
spec.test_files = `git ls-files -z test/`.split("\0")
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "minitest"
require_relative 'lib/dspace_rest_client'
require 'json'
client ='')
puts '#### status #### '
puts client.status
client.login '', 'dspace'
puts '#### after login ###'
puts client.status
puts '#### counting communities'
community_repository = client.repository.community_repository
all_communities = community_repository.get_all_communities
i = 0
all_communities.each do
i += 1
puts "dspace have #{i} communities"
\ No newline at end of file
gem build dspace-rest-client.gemspec \
&& \
gem install --local dspace-rest-client-0.0.1.gem
require "dspace/version"
module Dspace
# Your code goes here...
module Dspace
#the current dspace-rest-client version
VERSION = '2.0.0'
\ No newline at end of file
VERSION = "2.0.0"
require 'test_helper'
class DspaceTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Dspace::VERSION
def test_it_does_something_useful
assert false
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'dspace'
require 'minitest/unit'
require 'minitest/autorun'
require 'minitest/pride'
\ No newline at end of file
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