kcv 0.2.4 → 0.4.2

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: cc2d2778d7eb364332815098ddf87195de980ce4fd85b791cfad86ba9373f296
4
- data.tar.gz: 35c2012f6205fbb8bfd017f2e8777c61accea4e17ed3790fa331bf6a4db64485
3
+ metadata.gz: 74ec35b4823f625816fb7de86c36f06ceee7ef6b705a58c9f221d916f7e6db87
4
+ data.tar.gz: 990facb2d92b84ccd7ccb6c6c62952b740fb97bdf58cbe741253b947e339df28
5
5
  SHA512:
6
- metadata.gz: 9c66ea58454e2fbdaa8b8865f57d26b7ace988d2690f25ded932fb10351d1f03189d82349b32a40b64dff9d5add32c5b786812e4660ef9148ceccc671a14a0cf
7
- data.tar.gz: e7fb93dcbcc18a6758154c44a6e40944b4bf06352789403d847b183002b68cfb71705ac330559e38be090ec744d60b3a813094bda31aca0645ce4fefa4574844
6
+ metadata.gz: 731343972d841e1363dfd94c53afc0a062409fbe6687c2043e3db1a15bf5bf1eece90e387379cab4853effea4218901349c927e117f9332500524120e62f3e61
7
+ data.tar.gz: 6e461c4cbe23d75070a7d897d936abcc5d8d209b0b2cd1caf972edd0e8e454b398597b522c482b949b49d02e65939bee56df1cb75a851f3c783079a3039395e4
@@ -0,0 +1,32 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ matrix:
13
+ os: [ ubuntu-latest ]
14
+ ruby-version: [2.6, 2.7, 3.0, 3.1]
15
+
16
+ runs-on: ${{ matrix.os }}
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby ${{ matrix.ruby-version }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run linter for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
26
+ run: bin/standardrb
27
+ - name: Run tests for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
28
+ run: bin/rspec
29
+ - name: Report to Coveralls
30
+ uses: coverallsapp/github-action@1.1.3
31
+ with:
32
+ github-token: ${{ secrets.github_token }}
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  Gemfile.lock
11
11
  /*.gem
12
+
13
+ # rspec failure tracking
14
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ ruby_version: 3.0.0
data/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![Tests](https://github.com/mlibrary/kcv/actions/workflows/test.yml/badge.svg)](https://github.com/mlibrary/kcv/actions/workflows/test.yml)
2
+ [![Coverage Status](https://coveralls.io/repos/github/mlibrary/keycard/badge.svg?branch=main)](https://coveralls.io/github/mlibrary/kcv?branch=main)
3
+ [![User Docs](https://img.shields.io/badge/user_docs-readthedocs-blue.svg)](https://kcv.readthedocs.io/en/latest)
4
+ [![API Docs](https://img.shields.io/badge/API_docs-rubydoc.info-blue.svg)](https://www.rubydoc.info/gems/kcv)
5
+
1
6
  # KCV
2
7
 
3
8
  KCV is a glue gem for making it easy to use [Keycard](https://github.com/mlibrary/keycard),
@@ -23,6 +28,20 @@ And then execute:
23
28
 
24
29
  $ bundle
25
30
 
31
+ ## Compatibility
32
+
33
+ KCV is intended to be compatible with all community-supported Ruby branches (i.e., minor versions), currently:
34
+
35
+ - 2.6
36
+ - 2.7
37
+ - 3.0
38
+ - 3.1
39
+
40
+ We prefer the newest syntax and linting rules that preserve compatibility with the oldest branch in normal maintenance.
41
+ When the security maintenance for a branch expires, Keycard's compatibility should be considered unsupported.
42
+
43
+ See also, [Ruby's branch maintenance policy](https://www.ruby-lang.org/en/downloads/branches/).
44
+
26
45
  ## License
27
46
 
28
47
  Checkpoint is licensed under the BSD-3-Clause license. See [LICENSE.md](LICENSE.md).
data/bin/standardrb ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'standardrb' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("standard", "standardrb")
data/kcv.gemspec CHANGED
@@ -1,37 +1,38 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
5
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
5
  require "kcv/version"
7
6
 
8
7
  Gem::Specification.new do |spec|
9
- spec.name = "kcv"
10
- spec.version = KCV::VERSION
11
- spec.authors = ["Noah Botimer"]
12
- spec.email = ["botimer@umich.edu"]
8
+ spec.name = "kcv"
9
+ spec.version = KCV::VERSION
10
+ spec.authors = ["Noah Botimer"]
11
+ spec.email = ["botimer@umich.edu"]
13
12
 
14
- spec.summary = 'Glue gem for integration of Keycard, Checkpoint, and Vizier.'
15
- spec.description = <<~DESC
13
+ spec.summary = "Glue gem for integration of Keycard, Checkpoint, and Vizier."
14
+ spec.description = <<~DESC
16
15
  This gem provides utilities for using Keycard, Checkpoint, and Vizier together, which have
17
16
  no direct dependencies on each other. An application could implement any of these, but they
18
17
  provide a standard base implementation for convenience and consistency.
19
18
  DESC
20
- spec.homepage = "https://github.com/mlibrary/kcv"
19
+ spec.homepage = "https://github.com/mlibrary/kcv"
21
20
 
22
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
22
  f.match(%r{^(test|spec|features)/})
24
23
  end
25
- spec.bindir = "exe"
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
26
  spec.require_paths = ["lib"]
28
27
 
29
- spec.add_dependency "checkpoint", "~> 1.0.3"
30
- spec.add_dependency "keycard", "~> 0.2.4"
31
- spec.add_dependency "vizier", "~> 0.1.0"
28
+ spec.add_dependency "checkpoint", "~> 1.1.0"
29
+ spec.add_dependency "keycard", "~> 0.3.0"
30
+ spec.add_dependency "vizier", "~> 0.1.2"
32
31
 
33
- spec.add_development_dependency "bundler", "~> 1.16"
34
- spec.add_development_dependency "coveralls", "~> 0.8"
35
- spec.add_development_dependency "rake", "~> 10.0"
36
- spec.add_development_dependency "rspec", "~> 3.7"
32
+ spec.add_development_dependency "bundler", "~> 2.3"
33
+ spec.add_development_dependency "simplecov", "~> 0.21"
34
+ spec.add_development_dependency "simplecov-lcov", "~> 0.8"
35
+ spec.add_development_dependency "rake", "~> 13.0"
36
+ spec.add_development_dependency "rspec", "~> 3.11"
37
+ spec.add_development_dependency "standard", "~> 1.7"
37
38
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'checkpoint/agent'
4
- require 'ostruct'
3
+ require "checkpoint/agent"
5
4
 
6
5
  module KCV
7
6
  # Base AgentResolver to integrate Keycard and Checkpoint.
@@ -10,22 +9,20 @@ module KCV
10
9
  # which all attributes are extracted and delivered as agents, as converted
11
10
  # by the `agent_factory`.
12
11
  class AgentResolver < Checkpoint::Agent::Resolver
13
- def initialize(agent_factory: Checkpoint::Agent)
14
- @agent_factory = agent_factory
15
- end
16
-
17
- def resolve(actor)
18
- super + actor.identity.map { |k, v| agents_for(k, v) }.flatten
19
- end
12
+ IdentityAttribute = Struct.new(:agent_type, :agent_id)
20
13
 
21
- def agents_for(attribute, values)
22
- [values].flatten.map do |value|
23
- agent_factory.from(OpenStruct.new(agent_type: attribute, agent_id: value))
24
- end
14
+ def expand(actor)
15
+ [convert(actor)] + identity_agents(actor)
25
16
  end
26
17
 
27
18
  private
28
19
 
29
- attr_reader :agent_factory
20
+ def identity_agents(actor)
21
+ actor.identity.flat_map do |attr, values|
22
+ [values].flatten.map do |value|
23
+ convert IdentityAttribute.new(attr, value)
24
+ end
25
+ end
26
+ end
30
27
  end
31
28
  end
data/lib/kcv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KCV
4
- VERSION = "0.2.4"
4
+ VERSION = "0.4.2"
5
5
  end
data/lib/kcv.rb CHANGED
@@ -12,4 +12,4 @@ require "kcv/version"
12
12
  module KCV
13
13
  end
14
14
 
15
- require 'kcv/agent_resolver'
15
+ require "kcv/agent_resolver"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kcv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Botimer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: checkpoint
@@ -16,58 +16,72 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.3
19
+ version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.3
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: keycard
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.4
33
+ version: 0.3.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.2.4
40
+ version: 0.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: vizier
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.0
47
+ version: 0.1.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.0
54
+ version: 0.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.16'
61
+ version: '2.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.16'
68
+ version: '2.3'
69
69
  - !ruby/object:Gem::Dependency
70
- name: coveralls
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.21'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.21'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov-lcov
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
@@ -86,28 +100,42 @@ dependencies:
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '10.0'
103
+ version: '13.0'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '10.0'
110
+ version: '13.0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rspec
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '3.7'
117
+ version: '3.11'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.11'
125
+ - !ruby/object:Gem::Dependency
126
+ name: standard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.7'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '3.7'
138
+ version: '1.7'
111
139
  description: |
112
140
  This gem provides utilities for using Keycard, Checkpoint, and Vizier together, which have
113
141
  no direct dependencies on each other. An application could implement any of these, but they
@@ -119,9 +147,10 @@ extensions: []
119
147
  extra_rdoc_files: []
120
148
  files:
121
149
  - ".envrc"
150
+ - ".github/workflows/test.yml"
122
151
  - ".gitignore"
123
- - ".rubocop.yml"
124
- - ".travis.yml"
152
+ - ".rspec"
153
+ - ".standard.yml"
125
154
  - Gemfile
126
155
  - README.md
127
156
  - Rakefile
@@ -129,6 +158,7 @@ files:
129
158
  - bin/rake
130
159
  - bin/rspec
131
160
  - bin/setup
161
+ - bin/standardrb
132
162
  - kcv.gemspec
133
163
  - lib/kcv.rb
134
164
  - lib/kcv/agent_resolver.rb
@@ -151,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
181
  - !ruby/object:Gem::Version
152
182
  version: '0'
153
183
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.7.3
184
+ rubygems_version: 3.1.6
156
185
  signing_key:
157
186
  specification_version: 4
158
187
  summary: Glue gem for integration of Keycard, Checkpoint, and Vizier.
data/.rubocop.yml DELETED
@@ -1,30 +0,0 @@
1
- Rails:
2
- Enabled: true
3
-
4
- Rails/Delegate:
5
- Enabled: false
6
-
7
- # inherit_gem:
8
- # rubocop-rails:
9
- # - config/rails.yml
10
-
11
- AllCops:
12
- DisplayCopNames: true
13
- TargetRubyVersion: 2.4
14
- Exclude:
15
- - 'bin/**/*'
16
- - 'vendor/**/*'
17
-
18
- Layout/MultilineMethodDefinitionBraceLayout:
19
- EnforcedStyle: same_line
20
-
21
- Metrics/LineLength:
22
- Max: 110
23
-
24
- Metrics/BlockLength:
25
- Exclude:
26
- - '*.gemspec'
27
- ExcludedMethods: ['describe', 'context']
28
-
29
- Style/StringLiterals:
30
- Enabled: false
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.2
5
- before_install: gem install bundler -v 1.16.0