sdr-client 0.28.2 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +35 -0
- data/.rubocop.yml +1 -7
- data/.rubocop_todo.yml +15 -3
- data/README.md +1 -1
- data/lib/sdr_client.rb +1 -0
- data/lib/sdr_client/credentials.rb +3 -8
- data/lib/sdr_client/version.rb +1 -1
- data/sdr-client.gemspec +2 -2
- metadata +13 -13
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 999f1fcad7c001083d1ddb061042209a6242dad60947d324386f800c426ef1d6
|
4
|
+
data.tar.gz: 7f1b29ca7327f2eda0625c94e117844296932290446b9b3a90576e0307e93343
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04232a0f3dea514c51d12d2ead86abf0bdbd536bd60a183e69b1bf989c63128385b6d805291f7be18e430bf30515a836fd21cfcf16a8ba6c7bd033a3c1ad20d
|
7
|
+
data.tar.gz: f5f7ee090e48fd96a2a34fee00b18bd5b59c3c29ac8b600d7bdf2de7be0c30914b5df1a2daccea00115d1e003d26bf8d4f998397ddb4c5fc487d81b5dfe51d85
|
@@ -0,0 +1,35 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
docker:
|
6
|
+
- image: circleci/ruby:2.7.1
|
7
|
+
environment:
|
8
|
+
CC_TEST_REPORTER_ID: 859fcfe88b00c026d15dce30e838e2299face8088b49fe62bc3a02d1507ce3d5
|
9
|
+
RAILS_ENV: test
|
10
|
+
steps:
|
11
|
+
- checkout
|
12
|
+
- run:
|
13
|
+
name: Install Bundler
|
14
|
+
command: gem install bundler
|
15
|
+
- run:
|
16
|
+
name: Which bundler?
|
17
|
+
command: bundle -v
|
18
|
+
- run:
|
19
|
+
name: Bundle Install
|
20
|
+
command: bundle check || bundle install
|
21
|
+
- run:
|
22
|
+
name: Lint using rubocop
|
23
|
+
command: bundle exec rubocop
|
24
|
+
- run:
|
25
|
+
name: Setup Code Climate test-reporter
|
26
|
+
command: |
|
27
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
28
|
+
chmod +x ./cc-test-reporter
|
29
|
+
./cc-test-reporter before-build
|
30
|
+
- run:
|
31
|
+
name: rspec
|
32
|
+
command: bundle exec rspec
|
33
|
+
- run:
|
34
|
+
name: upload test coverage report to Code Climate
|
35
|
+
command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
inherit_from: .rubocop_todo.yml
|
3
2
|
|
4
3
|
AllCops:
|
@@ -7,11 +6,6 @@ AllCops:
|
|
7
6
|
- 'bin/console'
|
8
7
|
- 'vendor/**/*'
|
9
8
|
|
10
|
-
Layout/LineLength:
|
11
|
-
Max: 120
|
12
|
-
Exclude:
|
13
|
-
- 'spec/sdr_client/deposit/process_spec.rb'
|
14
|
-
|
15
9
|
Metrics/BlockLength:
|
16
10
|
Exclude:
|
17
11
|
- 'spec/**/*'
|
@@ -21,4 +15,4 @@ Metrics/BlockLength:
|
|
21
15
|
|
22
16
|
Naming/FileName:
|
23
17
|
Exclude:
|
24
|
-
- 'lib/sdr-client.rb'
|
18
|
+
- 'lib/sdr-client.rb'
|
data/.rubocop_todo.yml
CHANGED
@@ -1,17 +1,29 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-
|
3
|
+
# on 2020-06-24 17:02:25 -0700 using RuboCop version 0.79.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 2
|
10
|
-
# Configuration parameters: IgnoredMethods.
|
11
10
|
Metrics/AbcSize:
|
12
11
|
Max: 16
|
13
12
|
|
14
|
-
# Offense count:
|
13
|
+
# Offense count: 8
|
15
14
|
# Configuration parameters: CountComments, ExcludedMethods.
|
16
15
|
Metrics/MethodLength:
|
17
16
|
Max: 15
|
17
|
+
|
18
|
+
# Offense count: 1
|
19
|
+
# Cop supports --auto-correct.
|
20
|
+
Style/IfUnlessModifier:
|
21
|
+
Exclude:
|
22
|
+
- 'exe/sdr'
|
23
|
+
|
24
|
+
# Offense count: 187
|
25
|
+
# Cop supports --auto-correct.
|
26
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
27
|
+
# URISchemes: http, https
|
28
|
+
Layout/LineLength:
|
29
|
+
Max: 1228
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![
|
1
|
+
[![CircleCI](https://circleci.com/gh/sul-dlss/sdr-client.svg?style=svg)](https://circleci.com/gh/sul-dlss/sdr-client)
|
2
2
|
[![Maintainability](https://api.codeclimate.com/v1/badges/1210855d46d4f424bf30/maintainability)](https://codeclimate.com/github/sul-dlss/sdr-client/maintainability)
|
3
3
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/1210855d46d4f424bf30/test_coverage)](https://codeclimate.com/github/sul-dlss/sdr-client/test_coverage)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/sdr-client.svg)](https://badge.fury.io/rb/sdr-client)
|
data/lib/sdr_client.rb
CHANGED
@@ -9,21 +9,16 @@ module SdrClient
|
|
9
9
|
def self.write(body)
|
10
10
|
json = JSON.parse(body)
|
11
11
|
Dir.mkdir(credentials_path, 0o700) unless Dir.exist?(credentials_path)
|
12
|
-
File.
|
13
|
-
file.flock(File::LOCK_EX)
|
12
|
+
File.atomic_write(credentials_file) do |file|
|
14
13
|
file.write(json.fetch('token'))
|
15
|
-
file.flush
|
16
14
|
end
|
15
|
+
File.chmod(0o600, credentials_file)
|
17
16
|
end
|
18
17
|
|
19
18
|
def self.read
|
20
19
|
raise NoCredentialsError unless ::File.exist?(credentials_file)
|
21
20
|
|
22
|
-
creds =
|
23
|
-
File.open(credentials_file, 'r') do |file|
|
24
|
-
file.flock(File::LOCK_SH)
|
25
|
-
creds = file.readlines(chomp: true).first
|
26
|
-
end
|
21
|
+
creds = IO.readlines(credentials_file, chomp: true).first if ::File.exist?(credentials_file)
|
27
22
|
raise NoCredentialsError if creds.nil?
|
28
23
|
|
29
24
|
creds
|
data/lib/sdr_client/version.rb
CHANGED
data/sdr-client.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
30
|
spec.add_dependency 'activesupport'
|
31
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
31
|
+
spec.add_dependency 'cocina-models', '~> 0.37.0'
|
32
32
|
spec.add_dependency 'dry-monads'
|
33
33
|
spec.add_dependency 'faraday', '>= 0.16'
|
34
34
|
|
@@ -37,6 +37,6 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
38
|
spec.add_development_dependency 'rubocop', '~> 0.79.0'
|
39
39
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.37.1'
|
40
|
-
spec.add_development_dependency 'simplecov'
|
40
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.0' # CodeClimate cannot use SimpleCov >= 0.18.0 for generating test coverage
|
41
41
|
spec.add_development_dependency 'webmock', '~> 3.7'
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdr-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.37.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.37.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: dry-monads
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: simplecov
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 0.17.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 0.17.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: webmock
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,12 +173,12 @@ executables:
|
|
173
173
|
extensions: []
|
174
174
|
extra_rdoc_files: []
|
175
175
|
files:
|
176
|
+
- ".circleci/config.yml"
|
176
177
|
- ".github/pull_request_template.md"
|
177
178
|
- ".gitignore"
|
178
179
|
- ".rspec"
|
179
180
|
- ".rubocop.yml"
|
180
181
|
- ".rubocop_todo.yml"
|
181
|
-
- ".travis.yml"
|
182
182
|
- Gemfile
|
183
183
|
- LICENSE
|
184
184
|
- README.md
|
@@ -219,7 +219,7 @@ metadata:
|
|
219
219
|
homepage_uri: https://github.com/sul-dlss/sdr-client
|
220
220
|
source_code_uri: https://github.com/sul-dlss/sdr-client
|
221
221
|
changelog_uri: https://github.com/sul-dlss/sdr-client/releases
|
222
|
-
post_install_message:
|
222
|
+
post_install_message:
|
223
223
|
rdoc_options: []
|
224
224
|
require_paths:
|
225
225
|
- lib
|
@@ -234,8 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
- !ruby/object:Gem::Version
|
235
235
|
version: '0'
|
236
236
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
238
|
-
signing_key:
|
237
|
+
rubygems_version: 3.1.2
|
238
|
+
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: The CLI for https://github.com/sul-dlss/sdr-api
|
241
241
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
rvm:
|
6
|
-
- 2.6.4
|
7
|
-
before_install: gem install bundler -v 2.1.2
|
8
|
-
|
9
|
-
before_script:
|
10
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
-
- chmod +x ./cc-test-reporter
|
12
|
-
- ./cc-test-reporter before-build
|
13
|
-
after_script:
|
14
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
15
|
-
|
16
|
-
env:
|
17
|
-
global:
|
18
|
-
- CC_TEST_REPORTER_ID=859fcfe88b00c026d15dce30e838e2299face8088b49fe62bc3a02d1507ce3d5
|
19
|
-
notifications:
|
20
|
-
email: false
|