sdr-client 0.28.0 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8218f375715174e3c821a50017c93d6ea7608dec9e6d8eb3079da95687079ccf
4
- data.tar.gz: bcf2362444e2fcaff1da53670d421d2886a37c2e0cad1a49c312bf8d41d7decb
3
+ metadata.gz: d7915d64ec8b5b9da302a842d19f37892e37d87b3db42dd82425235a452fd7ee
4
+ data.tar.gz: 9df81b46cbadb0ae2f787b070f87341a94e5a5c8956adde7e4397a17674931cf
5
5
  SHA512:
6
- metadata.gz: c864d1c6642d3625a3d02e7d19cce2f434835baa67dd8d71e6060ed2ab45676eb7b4b7f930e1d2dac74cf640da29832fdab2e4c006e5cbed9723568274364972
7
- data.tar.gz: aaa132697e45bad33b362b3bb7c9eb431c2f718115c7cab985619376b29f62b1b9451c2e3a4276f6ab29b415e943ddced44527340c3d2526ba1d4459948a919a
6
+ metadata.gz: 17f1fc289f19810041b138a4ca2b6298362c4a7e9fa5fb42cdfc42b7f7292163689715c943ef056e12c541fc50de63e2c115b9f7ab78bcda69f093339b535a82
7
+ data.tar.gz: cef601f676e20c11264cafb4299f1bcdcad51d8b534961712e0e0d6ea78e3a3a809e581da2ea0d1e12775f2e7d0a0ec1a0035d61c1d0c85b20a4798845a5be40
@@ -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 $?
@@ -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'
@@ -1,17 +1,29 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-04-27 08:24:29 -0400 using RuboCop version 0.82.0.
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: 7
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
- [![Build Status](https://travis-ci.org/sul-dlss/sdr-client.svg?branch=master)](https://travis-ci.org/sul-dlss/sdr-client)
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)
@@ -5,6 +5,7 @@ require 'faraday'
5
5
  require 'active_support'
6
6
  require 'active_support/core_ext/object/json'
7
7
  require 'active_support/core_ext/hash/indifferent_access'
8
+ require 'active_support/core_ext/file/atomic'
8
9
  require 'cocina/models'
9
10
 
10
11
  require 'sdr_client/version'
@@ -9,15 +9,19 @@ 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.open(credentials_file, 'w', 0o600) do |file|
12
+ File.atomic_write(credentials_file) do |file|
13
13
  file.write(json.fetch('token'))
14
14
  end
15
+ File.chmod(0o600, credentials_file)
15
16
  end
16
17
 
17
18
  def self.read
18
19
  raise NoCredentialsError unless ::File.exist?(credentials_file)
19
20
 
20
- IO.readlines(credentials_file, chomp: true).first
21
+ creds = IO.readlines(credentials_file, chomp: true).first if ::File.exist?(credentials_file)
22
+ raise NoCredentialsError if creds.nil?
23
+
24
+ creds
21
25
  end
22
26
 
23
27
  def self.credentials_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '0.28.0'
4
+ VERSION = '0.29.0'
5
5
  end
@@ -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.33.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.34.1'
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.28.0
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-07-10 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.0
33
+ version: 0.34.1
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.33.0
40
+ version: 0.34.1
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: '0'
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: '0'
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
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  requirements: []
237
- rubygems_version: 3.0.3
237
+ rubygems_version: 3.1.2
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: The CLI for https://github.com/sul-dlss/sdr-api
@@ -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