kcv 0.1.0 → 0.1.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: b63d5b72b1a0cb5d1c4616e1c5a397ff1b2d962b29f9a8c81b5579c0f4599654
4
- data.tar.gz: eb868d698a8485521a71e213750715dc139aebf394dd6e59d531086fdaf4c9d1
3
+ metadata.gz: 1feba71dc13ee12069704a065973a680cb780736587350b3cf1febd00a5d5166
4
+ data.tar.gz: cb9441807426b4178629b15ccb7f1082a60663b1ec41c12ad45d420adea5bb6b
5
5
  SHA512:
6
- metadata.gz: 968a0ccb155eba06ed6bf40ac143e7d9dcf617c323c6a98f397eccdd9b890a81f660e0b9cd1245244f791c253e375b48e3b5b9b8dd369465be9f8667e12f93d7
7
- data.tar.gz: a41390eb0b9a263c6441eb9d192d9391612b535745e6c46c0d8ea6424c47f813a4162f9998e74b938aa9fe6f4d596ebd2cdadfe2d0b31cf6879a075dbc98c34c
6
+ metadata.gz: 2ea335ccfc9d80d3fd263fe54e71c1416ed7406b9101a5c75e4e2a4937c2d66267afc367aa12a27d7f9dbb0afb30c12e88588914367d38e613121d008b9812f0
7
+ data.tar.gz: 770702c550919b8abff2b68812e2190a67bfbf6e1f47f4806af71b1c35a2d7ea53dd9fc4db6c89f6fd3643e55edd64b791bd8f390db2dc89305911ed695a8eaa
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /tmp/
9
9
 
10
10
  Gemfile.lock
11
+ /*.gem
data/lib/kcv.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "keycard"
4
+ require "checkpoint"
5
+ require "vizier"
6
+
3
7
  require "kcv/version"
4
8
 
5
9
  # KCV is an integration package for Keycard, Checkpoint, and Vizier.
@@ -7,3 +11,5 @@ require "kcv/version"
7
11
  # This is the top-level module for all of the classes defined in this gem.
8
12
  module KCV
9
13
  end
14
+
15
+ require 'kcv/agent_resolver'
@@ -4,6 +4,11 @@ require 'checkpoint/agent'
4
4
  require 'ostruct'
5
5
 
6
6
  module KCV
7
+ # Base AgentResolver to integrate Keycard and Checkpoint.
8
+ #
9
+ # This resolver depends on the actor having the `#identity` method, from
10
+ # which all attributes are extracted and delivered as agents, as converted
11
+ # by the `agent_factory`.
7
12
  class AgentResolver < Checkpoint::Agent::Resolver
8
13
  def initialize(agent_factory: Checkpoint::Agent)
9
14
  @agent_factory = agent_factory
@@ -14,13 +19,13 @@ module KCV
14
19
  end
15
20
 
16
21
  def agents_for(attribute, values)
17
- [ values ].flatten.map do |value|
22
+ [values].flatten.map do |value|
18
23
  agent_factory.from(OpenStruct.new(agent_type: attribute, agent_id: value))
19
24
  end
20
25
  end
21
26
 
22
27
  private
23
28
 
24
- attr_reader :agent_factory
29
+ attr_reader :agent_factory
25
30
  end
26
31
  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.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kcv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Botimer