cocina-models 0.31.0 → 0.31.1

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: 10987f18b2d6489790ca3edbcead8ff6aa2fedfbca1bcb18d5606b8112c88f7e
4
- data.tar.gz: 1431af2debd70299b4574997d842f0107ce356b44b67123deedf237b08f669b9
3
+ metadata.gz: 56996d980d118dcf4b8d40ceff5ec6fbff8b24abb997c4b9e0197bb528b8d079
4
+ data.tar.gz: fbd4dc60749aa56fb60334efb0841a707e676a86117129c0f792bbe7cb8e6efe
5
5
  SHA512:
6
- metadata.gz: ff3ba29a4e6ca6a23bb55bdb12a2a4ef26852468155d812e9572a07b0711e6e22e549fbd186985e62b3b6e90deb501d938db62cf73c61823c80759a5d2b40fcc
7
- data.tar.gz: a480849d853c21828d5830f6227d9e169a1f9cefac484038ebd6d0f0d661d9c40e44e217e15cd62f80a9efcfad2a51ad8c009fbe6048040475c21a5f4485228e
6
+ metadata.gz: 2d329215bcbe26594b87741cd14eeb17d6d3059812ac9049782c8f5c571cb1243abdb46ce16f0c664704b834fbdf3984f37813aa0fc339b98fa58bf79ff35e96
7
+ data.tar.gz: 16a11f6ee008decd17ffee1bd3329e3c8b9d67ed6350d536a9f1526ecce6d28ccddba4ceff688b2e24163b93c8859e4798e050106a747b8fef2574c9f62df140
@@ -0,0 +1,51 @@
1
+ version: 2.1
2
+ executors:
3
+ docker-publisher:
4
+ docker:
5
+ - image: circleci/buildpack-deps:stretch
6
+ jobs:
7
+ test:
8
+ docker:
9
+ - image: circleci/ruby:2.7.0-node
10
+ steps:
11
+ - checkout
12
+ - run:
13
+ name: install bundler
14
+ command: gem install bundler -v 2.1.4
15
+ - run:
16
+ name: Install gem dependencies
17
+ command: bundle check || bundle install
18
+ - run:
19
+ name: Lint using rubocop
20
+ command: bundle exec rubocop
21
+ - run:
22
+ name: Setup Code Climate test-reporter
23
+ command: |
24
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
25
+ chmod +x ./cc-test-reporter
26
+ ./cc-test-reporter before-build
27
+ - run:
28
+ name: Run RSpec test suite
29
+ command: bundle exec rspec
30
+ - run:
31
+ name: upload test coverage report to Code Climate
32
+ command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
33
+ - run:
34
+ name: Validate API specification
35
+ command: |
36
+ sudo npm install -g openapi-enforcer-cli
37
+ result=$(openapi-enforcer validate openapi.yml)
38
+ [[ $result =~ "Document is valid" ]] && {
39
+ echo "Validation good"
40
+ exit 0
41
+ } || {
42
+ echo $result
43
+ exit 1
44
+ }
45
+
46
+ workflows:
47
+ version: 2
48
+
49
+ test:
50
+ jobs:
51
+ - test
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![Test Coverage](https://api.codeclimate.com/v1/badges/472273351516ac01dce1/test_coverage)](https://codeclimate.com/github/sul-dlss/cocina-models/test_coverage)
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/472273351516ac01dce1/maintainability)](https://codeclimate.com/github/sul-dlss/cocina-models/maintainability)
4
4
  [![Gem Version](https://badge.fury.io/rb/cocina-models.svg)](https://badge.fury.io/rb/cocina-models)
5
+ [![OpenAPI Validator](http://validator.swagger.io/validator?url=https://raw.githubusercontent.com/sul-dlss/cocina-models/master/openapi.yml)](http://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/sul-dlss/cocina-models/master/openapi.yml)
5
6
 
6
7
  # Cocina::Models
7
8
 
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rspec', '~> 3.0'
38
38
  spec.add_development_dependency 'rubocop', '~> 0.74.0'
39
39
  spec.add_development_dependency 'rubocop-rspec'
40
- spec.add_development_dependency 'simplecov'
40
+ spec.add_development_dependency 'simplecov', '~> 0.17.0'
41
41
  end
@@ -4,6 +4,6 @@
4
4
  require 'bundler/setup'
5
5
  $LOAD_PATH.unshift 'lib'
6
6
 
7
- require 'cocina/generator'
7
+ require 'cocina/models'
8
8
 
9
9
  Cocina::Generator::Generator.start(ARGV)
@@ -1,16 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'zeitwerk'
4
- require 'yaml'
5
- require 'active_support/core_ext/string'
6
- require 'thor'
7
- require 'openapi3_parser'
8
- require 'byebug'
9
-
10
- loader = Zeitwerk::Loader.new
11
- loader.push_dir(File.absolute_path("#{__FILE__}/../.."))
12
- loader.setup
13
-
14
3
  module Cocina
15
4
  # Module for generating Cocina models from openapi.
16
5
  module Generator
@@ -5,9 +5,12 @@ require 'zeitwerk'
5
5
  require 'dry-struct'
6
6
  require 'dry-types'
7
7
  require 'json'
8
+ require 'yaml'
8
9
  require 'openapi_parser'
10
+ require 'openapi3_parser'
9
11
  require 'active_support/core_ext/hash/indifferent_access'
10
- require 'yaml'
12
+ require 'active_support/core_ext/string'
13
+ require 'thor'
11
14
 
12
15
  # Help Zeitwerk find some of our classes
13
16
  class CocinaModelsInflector < Zeitwerk::Inflector
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.31.0'
5
+ VERSION = '0.31.1'
6
6
  end
7
7
  end
@@ -320,7 +320,7 @@ components:
320
320
  required:
321
321
  - value
322
322
  - type: object
323
- - required:
323
+ required:
324
324
  - structuredValue
325
325
  Description:
326
326
  type: object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.31.1
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-03-24 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -196,16 +196,16 @@ dependencies:
196
196
  name: simplecov
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '0'
201
+ version: 0.17.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '0'
208
+ version: 0.17.0
209
209
  description: SDR data models that can be validated
210
210
  email:
211
211
  - jcoyne@justincoyne.com
@@ -214,12 +214,12 @@ executables:
214
214
  extensions: []
215
215
  extra_rdoc_files: []
216
216
  files:
217
+ - ".circleci/config.yml"
217
218
  - ".github/pull_request_template.md"
218
219
  - ".gitignore"
219
220
  - ".rspec"
220
221
  - ".rubocop.yml"
221
222
  - ".rubocop_todo.yml"
222
- - ".travis.yml"
223
223
  - Gemfile
224
224
  - README.md
225
225
  - Rakefile
@@ -1,23 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.3
7
- - 2.6.4
8
- before_install: gem install bundler -v 2.1.4
9
-
10
- before_script:
11
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
12
- - chmod +x ./cc-test-reporter
13
- - ./cc-test-reporter before-build
14
-
15
- after_script:
16
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
17
-
18
- notifications:
19
- email: false
20
-
21
- env:
22
- global:
23
- - CC_TEST_REPORTER_ID=882e943342bed5285a6078be9a41b7738ae7ebd17458c08414581cbece99b8e6