modify all gem structure to add tests and binary files

parent 56363fe7
*.gem
/.bundle/
/.yardoc
/Gemfile.lock
/.bundle
/vendor
/doc
/pkg
/rdoc
/.idea
\ No newline at end of file
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
/_lib/
/.idea/
language: ruby
rvm:
- 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](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
source 'https://rubygems.org'
# Specify your gem's dependencies in mark.gemspec
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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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
Login
## Installation
Add this line to your application's Gemfile:
```ruby
require 'dspace-rest-client'
gem 'mark'
```
client = DspaceClient.new('https://demo.dspace.org/rest')
client.login 'dspacedemo+admin@gmail.com', 'dspace'
And then execute:
# check the status after authentication
puts client.status
```
$ bundle
List communities
Or install it yourself as:
```ruby
require 'dspace-rest-client'
$ gem install mark
client = DspaceClient.new('https://demo.dspace.org/rest')
community_repository = client.repository.community_repository
all_communities = community_repository.get_all_communities
## Usage
all_communities.each do |c|
puts c.name
end
```
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
1.0.0
### Contributors
> - Mauricio Giacomini Girardello <mgg12@inf.ufpr.br>
> - Bruno Zanette <>
### Installation
You need compile the gem:
```sh
$ gem build dspace-rest-client.gemspec
```
## Development
To install:
```sh
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 [rubygems.org](https://rubygems.org).
License
----
MIT
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
**Free Software, Hell Yeah!**
\ No newline at end of file
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
end
task :default => :test
module Dspace
#the current dspace-rest-client version
VERSION = '2.0.0'
end
\ 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"
IRB.start
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
bundle install
# Do any other automated setup that you need to do here
---
:rubygems_api_key: cfa0bd29364baee94fbf1ab847955136
Gem::Specification.new do |s|
s.name = 'dspace_rest_client'
s.version = '2.0.0'
s.date = '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.email = 'c3sl@c3sl.ufpr.br'
s.files = `git ls-files -z`.split("\0")
s.test_files = `git ls-files -z test/`.split("\0")
s.homepage = 'https://gitlab.c3sl.ufpr.br/c3sl/dspace-rest-client'
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'
Gem::Specification.new do |spec|
spec.date = '2015-11-23'
spec.name = "dspace_rest_client"
spec.version = Dspace::VERSION
spec.authors = ["Mauricio Giacomini Girardello", "Lucas Ernesto Kindinger", "Bruno N. Zanette", "Mateus Rambo Strey"]
spec.email = ["mauriciogiacomini4@gmail.com", "kindingerlek@hotmail.com"]
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 = 'https://gitlab.c3sl.ufpr.br/c3sl/dspace-rest-client'
spec.license = 'GNU - General Public License'
# Prevent pushing this gem to RubyGems.org 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 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
end
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"
end
require_relative 'lib/dspace_rest_client'
require 'json'
client = DspaceClient.new('https://demo.dspace.org/rest')
puts '#### status #### '
puts client.status
client.login 'dspacedemo+admin@gmail.com', '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
end
puts "dspace have #{i} communities"
\ No newline at end of file
#!/bin/bash
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...
end
module Dspace
#the current dspace-rest-client version
VERSION = '2.0.0'
end
\ No newline at end of file
VERSION = "2.0.0"
end
require 'test_helper'
class DspaceTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Dspace::VERSION
end
def test_it_does_something_useful
assert false
end
end
$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