odca 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 562f570cb79b02ab96b7a11c6f420618cd3c492c
4
- data.tar.gz: 2ada1a4608bbe3ebc638a48a7930e1c400822833
3
+ metadata.gz: cccb246024fcc5e44f92849d08b4b4c86182bb7a
4
+ data.tar.gz: a350bd63f3c28006b3e388cd75effec8a9519c6f
5
5
  SHA512:
6
- metadata.gz: 650781f9962b095d9453df16e1a308e56106efbc9bba6161f7024c3ece4e43433be408defe70e74968cbbb035ad2a3971bf179b469740e6cc8fc28d74f9357d8
7
- data.tar.gz: fb3b5e88c8c20294e8c2b702edab6030027694f05123dd1294d0f06eb675ee8b5c4d250830709be5d468eb3ad2d6c20557faf3bd660b6728b1e4cc787697f6f8
6
+ metadata.gz: 55daa2ef722c03e70aeb861267c3c279c31a5033a75a21f3d17ded9e0781b7029756fb8e5ee84c90b3c77b0b33f4b66ee0361fd88641bcae38a879157b3a7e57
7
+ data.tar.gz: e95d9fc2af7fd58f13df4e9cfcc4ada24d923dbe5ac7f0dc4dcb2102429a05dd623f17e7009ad2bb8b0e23f8011616ff8ed2187cacf85122f2c859432f83f98c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- odca (0.1.2)
4
+ odca (0.1.3)
5
5
  base58 (~> 0.2)
6
6
 
7
7
  GEM
@@ -1,35 +1,26 @@
1
1
  label:
2
2
  type_v1: spec/overlay/label/1.0
3
- description: Category and attribute labels for %{schema_name}
4
3
 
5
4
  format:
6
5
  type_v1: spec/overlay/format/1.0
7
- description: Attribute formats for %{schema_name}
8
6
 
9
7
  encode:
10
8
  type_v1: spec/overlay/encode/1.0
11
- description: Character set encoding for %{schema_name}
12
9
 
13
10
  entry:
14
11
  type_v1: spec/overlay/entry/1.0
15
- description: Field entries for %{schema_name}
16
12
 
17
13
  information:
18
14
  type_v1: spec/overlay/information/1.0
19
- description: Informational items for %{schema_name}
20
15
 
21
16
  conditional:
22
17
  type_v1: spec/overlay/conditional/1.0
23
- description:
24
18
 
25
19
  source:
26
20
  type_v1: spec/overlay/source/1.0
27
- description: Source endpoints for %{schema_name}
28
21
 
29
22
  review:
30
23
  type_v1: spec/overlay/review/1.0
31
- description: Field entry review comments for %{schema_name}
32
24
 
33
25
  masking:
34
26
  type_v1: spec/overlay/masking/1.0
35
- description: Masking attributes for %{schema_name}
@@ -7,7 +7,7 @@ module Odca
7
7
  def self.call(schema)
8
8
  Base58.encode(
9
9
  Digest::SHA2.hexdigest(
10
- JSON.pretty_generate(schema)
10
+ JSON.generate(schema)
11
11
  ).to_i(16)
12
12
  )
13
13
  end
@@ -32,11 +32,7 @@ module Odca
32
32
  Odca::Overlays::Header.new(
33
33
  role: role,
34
34
  purpose: purpose,
35
- type: overlay_info['type_v1'],
36
- description: format(
37
- overlay_info['description'],
38
- schema_name: parentful_overlay.parent.name
39
- )
35
+ type: overlay_info['type_v1']
40
36
  )
41
37
  end
42
38
 
@@ -1,13 +1,12 @@
1
1
  module Odca
2
2
  module Overlays
3
3
  class Header
4
- attr_reader :issued_by, :role, :purpose, :description, :type
4
+ attr_reader :issued_by, :role, :purpose, :type
5
5
 
6
- def initialize(role:, purpose:, description:, type:, issued_by: '')
6
+ def initialize(role:, purpose:, type:, issued_by: '')
7
7
  @issued_by = issued_by
8
8
  @role = role
9
9
  @purpose = purpose
10
- @description = description
11
10
  @type = type
12
11
  end
13
12
 
@@ -15,7 +14,6 @@ module Odca
15
14
  {
16
15
  '@context' => 'https://odca.tech/overlays/v1',
17
16
  type: type,
18
- description: description,
19
17
  issued_by: issued_by,
20
18
  role: role || '',
21
19
  purpose: purpose || ''
@@ -19,12 +19,24 @@ module Odca
19
19
  overlay_attrs = {}
20
20
  overlay_indexes = overlay_dtos.map(&:index)
21
21
 
22
+ entry_overlay_indexes = overlay_dtos.select do |ov|
23
+ ov.name == 'Entry Overlay'
24
+ end.map(&:index)
25
+
22
26
  records.each do |row|
23
27
  attr_name = row[3]
28
+ attr_type = row[4]
29
+ entry_overlay_indexes.each do |ov_index|
30
+ if row[ov_index]
31
+ attr_type = 'Array[Text]'
32
+ break
33
+ end
34
+ end
35
+
24
36
  schema_base.add_attribute(
25
37
  SchemaBase::Attribute.new(
26
38
  name: attr_name,
27
- type: row[4],
39
+ type: attr_type,
28
40
  pii: row[5]
29
41
  )
30
42
  )
data/lib/odca/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Odca
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - THCLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-18 00:00:00.000000000 Z
11
+ date: 2019-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base58