metatron 0.8.7 → 0.8.8

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: 52d22498fe02fb79914a0d75e7fc7bc278fdd03d2d225b56c9e839bae4860dbf
4
- data.tar.gz: d1268b434bf31755a53d75fe9d837ab1e963f39343f1447d697b585058f219e2
3
+ metadata.gz: 391fa61dd0511b360cf7a0327d6b5de19d9094908349feb79804ef2695db0950
4
+ data.tar.gz: 1db1d4a4590db27056933cb052445f2fecb4a856d024e0df8322e7379e3414ba
5
5
  SHA512:
6
- metadata.gz: 4c293e9bb179a67cff17d6323bec2075222b5d3ab9af292ad751e660a1a3c9c4e4941fc2ee0f3654cf472ec7adcc214738c6bc491050606e2f03f70574a91613
7
- data.tar.gz: 3c8e6a36034dfd4212fdbaadcd4a8b3e34b38d9e7be6d156768dd3ecb55f1c82023acd5699ccb532696def55de73f6f48d21d22657e1f47e2710ee44e00cd6b2
6
+ metadata.gz: 305f8fd71865860a6f85e21c79f0f6426bcb0cf260e63483d09c192a326de713db53f1da8a64728c336627ea239d6cb55c25272f56ca44785ed48d1c7300a6d9
7
+ data.tar.gz: effcc2c4603ead394a4a816412cf0460ff9c52a21621987492b17433e239fb8f695e014b252a463f32cecd41d76f5d6cb112bbbd32417ab93aaad5e7c971a148
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.8.7)
4
+ metatron (0.8.8)
5
5
  json (~> 2.6)
6
6
  rack (>= 2.2.8, < 4)
7
7
 
@@ -14,38 +14,41 @@ GEM
14
14
  byebug (11.1.3)
15
15
  diff-lcs (1.5.1)
16
16
  docile (1.4.1)
17
- e2mmap (0.1.0)
18
17
  jaro_winkler (1.6.0)
19
- json (2.9.1)
18
+ json (2.10.1)
20
19
  kramdown (2.5.1)
21
20
  rexml (>= 3.3.9)
22
21
  kramdown-parser-gfm (1.1.0)
23
22
  kramdown (~> 2.0)
24
- language_server-protocol (3.17.0.3)
25
- nokogiri (1.18.1-arm64-darwin)
23
+ language_server-protocol (3.17.0.4)
24
+ logger (1.6.5)
25
+ nokogiri (1.18.2-arm64-darwin)
26
26
  racc (~> 1.4)
27
- nokogiri (1.18.1-x86_64-linux-gnu)
27
+ nokogiri (1.18.2-x86_64-linux-gnu)
28
28
  racc (~> 1.4)
29
+ observer (0.1.2)
30
+ ostruct (0.6.1)
29
31
  parallel (1.26.3)
30
- parser (3.3.7.0)
32
+ parser (3.3.7.1)
31
33
  ast (~> 2.4.1)
32
34
  racc
33
35
  racc (1.8.1)
34
- rack (3.1.8)
36
+ rack (3.1.10)
35
37
  rack-test (2.2.0)
36
38
  rack (>= 1.3)
37
39
  rainbow (3.1.1)
38
40
  rake (12.3.3)
39
- rbs (2.8.4)
41
+ rbs (3.8.1)
42
+ logger
40
43
  regexp_parser (2.10.0)
41
- reverse_markdown (2.1.1)
44
+ reverse_markdown (3.0.0)
42
45
  nokogiri
43
46
  rexml (3.4.0)
44
47
  rspec (3.13.0)
45
48
  rspec-core (~> 3.13.0)
46
49
  rspec-expectations (~> 3.13.0)
47
50
  rspec-mocks (~> 3.13.0)
48
- rspec-core (3.13.2)
51
+ rspec-core (3.13.3)
49
52
  rspec-support (~> 3.13.0)
50
53
  rspec-expectations (3.13.3)
51
54
  diff-lcs (>= 1.2.0, < 2.0)
@@ -54,17 +57,17 @@ GEM
54
57
  diff-lcs (>= 1.2.0, < 2.0)
55
58
  rspec-support (~> 3.13.0)
56
59
  rspec-support (3.13.2)
57
- rubocop (1.70.0)
60
+ rubocop (1.71.2)
58
61
  json (~> 2.3)
59
62
  language_server-protocol (>= 3.17.0)
60
63
  parallel (~> 1.10)
61
64
  parser (>= 3.3.0.2)
62
65
  rainbow (>= 2.2.2, < 4.0)
63
66
  regexp_parser (>= 2.9.3, < 3.0)
64
- rubocop-ast (>= 1.36.2, < 2.0)
67
+ rubocop-ast (>= 1.38.0, < 2.0)
65
68
  ruby-progressbar (~> 1.7)
66
69
  unicode-display_width (>= 2.4.0, < 4.0)
67
- rubocop-ast (1.37.0)
70
+ rubocop-ast (1.38.0)
68
71
  parser (>= 3.3.1.0)
69
72
  rubocop-capybara (2.21.0)
70
73
  rubocop (~> 1.41)
@@ -89,18 +92,20 @@ GEM
89
92
  simplecov (~> 0.19)
90
93
  simplecov-html (0.13.1)
91
94
  simplecov_json_formatter (0.1.4)
92
- solargraph (0.50.0)
95
+ solargraph (0.51.2)
93
96
  backport (~> 1.2)
94
97
  benchmark
95
98
  bundler (~> 2.0)
96
99
  diff-lcs (~> 1.4)
97
- e2mmap
98
- jaro_winkler (~> 1.5)
100
+ jaro_winkler (~> 1.6)
99
101
  kramdown (~> 2.3)
100
102
  kramdown-parser-gfm (~> 1.1)
103
+ logger (~> 1.6)
104
+ observer (~> 0.1)
105
+ ostruct (~> 0.6)
101
106
  parser (~> 3.0)
102
- rbs (~> 2.0)
103
- reverse_markdown (~> 2.0)
107
+ rbs (~> 3.0)
108
+ reverse_markdown (>= 2.0, < 4)
104
109
  rubocop (~> 1.38)
105
110
  thor (~> 1.0)
106
111
  tilt (~> 2.0)
@@ -7,10 +7,13 @@ module Metatron
7
7
  include Concerns::Annotated
8
8
  include Concerns::Namespaced
9
9
 
10
- attr_accessor :additional_labels, :storage_class, :access_modes, :storage
10
+ attr_accessor :additional_labels, :data_source, :data_source_ref, :storage_class,
11
+ :access_modes, :storage
11
12
 
12
13
  alias storageClassName storage_class
13
14
  alias accessModes access_modes
15
+ alias dataSource data_source
16
+ alias dataSourceRef data_source_ref
14
17
 
15
18
  def initialize(
16
19
  name,
@@ -22,6 +25,7 @@ module Metatron
22
25
  @storage_class = storage_class
23
26
  @access_modes = access_modes
24
27
  @storage = storage
28
+ @data_source = {}
25
29
  @additional_labels = {}
26
30
  end
27
31
 
@@ -41,9 +45,33 @@ module Metatron
41
45
  storage:
42
46
  }
43
47
  }
44
- }
48
+ }.merge(formatted_data_source).merge(formatted_data_source_ref)
45
49
  }
46
50
  end
51
+
52
+ def formatted_data_source
53
+ return {} unless data_source && !data_source.empty?
54
+ raise "dataSource must be a Hash" unless data_source.is_a?(Hash)
55
+
56
+ valid_keys = %i[apiGroup kind name]
57
+ unless data_source.keys.all? { valid_keys.include?(_1.to_sym) }
58
+ raise "dataSource may contain only the keys: #{valid_keys.join(", ")}"
59
+ end
60
+
61
+ { dataSource: data_source.transform_keys(&:to_sym) }
62
+ end
63
+
64
+ def formatted_data_source_ref
65
+ return {} unless data_source_ref && !data_source_ref.empty?
66
+ raise "dataSourceRef must be a Hash" unless data_source_ref.is_a?(Hash)
67
+
68
+ valid_keys = %i[apiGroup kind name namespace]
69
+ unless data_source_ref.keys.all? { valid_keys.include?(_1.to_sym) }
70
+ raise "dataSourceRef may contain only the keys: #{valid_keys.join(", ")}"
71
+ end
72
+
73
+ { dataSourceRef: data_source_ref.transform_keys(&:to_sym) }
74
+ end
47
75
  end
48
76
  end
49
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metatron
4
- VERSION = "0.8.7"
4
+ VERSION = "0.8.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-19 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json