dor-services-client 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +14 -0
- data/README.md +29 -8
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9a014a5399050c8fbb36f61a3dccfcef19c9d6ece0dba3dbe5c77f5d2cc68d9
|
4
|
+
data.tar.gz: 33bcf38b482c228139dafd4749c121c1c4ca1f3000e2e47ae76695171026b06d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e74d8b9cc1194ffb8907743d1467cf952d39d4ef7e7f9c49e83551fef9c6310f8ab11181c5763c4c7a429bbe1afd63f1046d83552c176778322f4b93f68b6e80
|
7
|
+
data.tar.gz: bc7017b700945dcfb3f3a2093167694d984132d00957bba5274e6f60cd4894128d0339cbf5809f58a1c9c574e9b64739ad64ae6e1a05f63d6f1d10eb5cc7e48a
|
data/LICENSE
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright (c) 2018 by The Board of Trustees of the Leland Stanford
|
2
|
+
Junior University. All rights reserved.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
|
+
may not use this file except in compliance with the License. You
|
6
|
+
may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
13
|
+
implied. See the License for the specific language governing
|
14
|
+
permissions and limitations under the License.
|
data/README.md
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/dor-services-client.svg)](https://badge.fury.io/rb/dor-services-client)
|
2
|
-
[![Build Status](https://travis-ci.com/sul-dlss/dor-services-client.svg?branch=master)](https://travis-ci.com/sul-dlss/dor-services-client)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/dor-services-client.svg)](https://badge.fury.io/rb/dor-services-client)
|
2
|
+
[![Build Status](https://travis-ci.com/sul-dlss/dor-services-client.svg?branch=master)](https://travis-ci.com/sul-dlss/dor-services-client)
|
3
3
|
[![Code Climate](https://codeclimate.com/github/sul-dlss/dor-services-client/badges/gpa.svg)](https://codeclimate.com/github/sul-dlss/dor-services-client)
|
4
|
-
|
4
|
+
[![Code Climate Test Coverage](https://codeclimate.com/github/sul-dlss/dor-services-client/badges/coverage.svg)](https://codeclimate.com/github/sul-dlss/dor-services-client/coverage)
|
5
5
|
|
6
6
|
# Dor::Services::Client
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
TODO: Delete this and the text above, and describe your gem
|
8
|
+
Dor::Services::Client is a Ruby gem that acts as a client to the RESTful HTTP APIs provided by [dor-services-app](https://github.com/sul-dlss/dor-services-app). The gem is intended to be used as a replacement to the [dor-services gem](https://github.com/sul-dlss/dor-services)
|
11
9
|
|
12
10
|
## Installation
|
13
11
|
|
@@ -27,7 +25,26 @@ Or install it yourself as:
|
|
27
25
|
|
28
26
|
## Usage
|
29
27
|
|
30
|
-
|
28
|
+
To configure the client, you may do so globally (say, in a Rails initializer):
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'dor/services/client'
|
32
|
+
|
33
|
+
Dor::Services::Client.configure(url: Settings.DOR_SERVICES.URL,
|
34
|
+
username: Settings.DOR_SERVICES.USER,
|
35
|
+
password: Settings.DOR_SERVICES.PASS)
|
36
|
+
```
|
37
|
+
|
38
|
+
Note that the client may not be used without first having been configured, and the `url` keyword is required. The `username` and `password` arguments are optional. (If you are working in a project where the credentials are embedded in the URL, that ought to work just fine as well.)
|
39
|
+
|
40
|
+
Then you can invoke methods on the client that correspond to dor-services-app API requests, e.g.:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
# This API endpoint returns JSON
|
44
|
+
response = Dor::Services::Client.register(params: { druid: 'druid:123' })
|
45
|
+
response[:pid]
|
46
|
+
# => 'druid:123'
|
47
|
+
```
|
31
48
|
|
32
49
|
## Development
|
33
50
|
|
@@ -37,4 +54,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
37
54
|
|
38
55
|
## Contributing
|
39
56
|
|
40
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
57
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sul-dlss/dor-services-client
|
58
|
+
|
59
|
+
## Copyright
|
60
|
+
|
61
|
+
Copyright (c) 2018 Stanford Libraries. See LICENSE for details.
|
data/lib/dor/services/client.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-12-
|
12
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- ".rubocop_todo.yml"
|
144
144
|
- ".travis.yml"
|
145
145
|
- Gemfile
|
146
|
+
- LICENSE
|
146
147
|
- README.md
|
147
148
|
- Rakefile
|
148
149
|
- bin/console
|
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
176
|
version: '0'
|
176
177
|
requirements: []
|
177
178
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.7.
|
179
|
+
rubygems_version: 2.7.8
|
179
180
|
signing_key:
|
180
181
|
specification_version: 4
|
181
182
|
summary: A client for dor-services-app
|