dor-services-client 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbe8578f95f4533b0b91fe9a3c47ede0d1ba51db157e5f015928ba7b5b1fe19e
4
- data.tar.gz: b3e4e136c27186b625b86ebc138d59f032e03f1f6c908f65ee6c7206c73c7143
3
+ metadata.gz: d9a014a5399050c8fbb36f61a3dccfcef19c9d6ece0dba3dbe5c77f5d2cc68d9
4
+ data.tar.gz: 33bcf38b482c228139dafd4749c121c1c4ca1f3000e2e47ae76695171026b06d
5
5
  SHA512:
6
- metadata.gz: 933595fee0dbdec82b6d46c5b1bb63ed0cf4022d702ae97df1c294a8688d14e080fc893303ea981def0f9d8d86d08afff16517811a1e26fbd611258023259025
7
- data.tar.gz: fd88271153d2c461cedacfb7447c22fc4c47b87db50c5d44b8484a9f63fdb56ebc285006605ee5280a43688aa4461dae8cf3cb72f0d29dffec496e7a33531e76
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
- [![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)
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
- 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/dor/services/client`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/dor-services-client.
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.
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '0.5.0'
6
+ VERSION = '0.6.0'
7
7
  end
8
8
  end
9
9
  end
@@ -55,6 +55,8 @@ module Dor
55
55
  instance.password = password
56
56
  # Force connection to be re-established when `.configure` is called
57
57
  instance.connection = nil
58
+
59
+ self
58
60
  end
59
61
 
60
62
  delegate :objects, :files, :workflow, :workspace, :release_tags, to: :instance
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.5.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-20 00:00:00.000000000 Z
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.6
179
+ rubygems_version: 2.7.8
179
180
  signing_key:
180
181
  specification_version: 4
181
182
  summary: A client for dor-services-app