README.md 968 Bytes
Newer Older
1
# DSpace REST Client
Mauricio Giacomini Girardello's avatar
Mauricio Giacomini Girardello committed
2

3
4
5
## Installation

Add this line to your application's Gemfile:
Mauricio Giacomini Girardello's avatar
Mauricio Giacomini Girardello committed
6
7

```ruby
8
gem 'dspace_rest_client'
9
```
10

11
And then execute:
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
12

13
    $ bundle
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
14

15
Or install it yourself as:
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
16

17
    $ gem install dspace_rest_client
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
18

19
## Get started
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
20

21
Some requests requires user authentication.
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
22

23
24
25
26
27
28
29
```ruby
require 'dspace'
client = Dspace::Client.new(dspace_api: 'https://demo.dspace.org/')

if !client.is_running?
  raise 'Can\'t connect to DSpace API.'
end
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
30

31
32
33
34
35
36
37
38
# authenticate
client.login 'dspacedemo+admin@gmail.com', 'dspace'

# create an community
client.communities.create(Dspace::Community.new({'name' => 'Testando'}))
```

## Development
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
39

40
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
41

42
## Contributing
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
43

44
Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration.
Bruno Nocera Zanette's avatar
Bruno Nocera Zanette committed
45