kube-dsl 0.8.0 → 0.8.2
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/kube-dsl/dsl_object.rb +1 -1
- data/lib/kube-dsl/entrypoint_builder.rb +2 -1
- data/lib/kube-dsl/key_value_field_res.rb +1 -1
- data/lib/kube-dsl/object_field_res.rb +2 -2
- data/lib/kube-dsl/rbi_helpers.rb +1 -1
- data/lib/kube-dsl/validations.rb +2 -0
- data/lib/kube-dsl/value_fields.rb +6 -6
- data/lib/kube-dsl/version.rb +1 -1
- data/rbi/kube-dsl.rbi +1661 -1661
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 999f2bf83f428a8df758af2b435fb0aa64b8e69a722ff8eeb7ffc9837573a1ba
|
4
|
+
data.tar.gz: 735868e4588d34645f9cc7164ddb21f363b2b3af1b7a9b8b1ad6c4e5cb506a02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4a68116b5fefcf99bddd0857e43907f4dead424e51a5b6e76d1845c5264b193cefb871502a351aa172445ff47ad7fcdb39cc02eaec4050fb3e8bcb1f86930d
|
7
|
+
data.tar.gz: 5b4065446416e170515e3138d42805c1a2c0c8ab128b505f565c7135a2e587d87808811ef3be70a1726aece93d709b35eb1db882ac766b20e5d3009a3303d1d5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 0.8.2
|
2
|
+
* Fix entrypoint type signatures to make the block optional (#8, @Bo98)
|
3
|
+
* Tighten arity of value and object fields (#9, @Bo98)
|
4
|
+
|
5
|
+
## 0.8.1
|
6
|
+
* Fix Sorbet types for blocks passed to DSL methods (#6, @Bo98)
|
7
|
+
* Fix handling of number types (#5, @Bo98)
|
8
|
+
|
1
9
|
## 0.8.0
|
2
10
|
|
3
11
|
* Update Kubernetes to v1.23.17 to match kuby.
|
data/lib/kube-dsl/dsl_object.rb
CHANGED
@@ -7,7 +7,7 @@ module KubeDSL
|
|
7
7
|
extend ::KubeDSL::ValueFields
|
8
8
|
extend ::KubeDSL::Validations
|
9
9
|
|
10
|
-
# T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.void)).void }
|
10
|
+
# T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.bind(::KubeDSL::DSLObject).void)).void }
|
11
11
|
def initialize(&block)
|
12
12
|
instance_eval(&block) if block
|
13
13
|
end
|
@@ -42,8 +42,9 @@ module KubeDSL
|
|
42
42
|
next if block && !block.call(resource, ns)
|
43
43
|
|
44
44
|
method_name = method_name_for(resource)
|
45
|
+
resource_type = "::#{ns}::#{resource.ref.kind}"
|
45
46
|
|
46
|
-
rbi_code << "#{indent}T::Sig::WithoutRuntime.sig { params(block: T.proc.void).returns(
|
47
|
+
rbi_code << "#{indent}T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.bind(#{resource_type}).void)).returns(#{resource_type}) }\n"
|
47
48
|
rbi_code << "#{indent}def #{method_name}(&block); end\n\n"
|
48
49
|
end
|
49
50
|
|
@@ -22,7 +22,7 @@ module KubeDSL
|
|
22
22
|
|
23
23
|
def fields_to_rbi(_inflector)
|
24
24
|
[
|
25
|
-
"T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.void)).returns(::KubeDSL::KeyValueFields) }",
|
25
|
+
"T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.bind(::KubeDSL::KeyValueFields).void)).returns(::KubeDSL::KeyValueFields) }",
|
26
26
|
"def #{underscore(name)}(&block); end"
|
27
27
|
]
|
28
28
|
end
|
@@ -18,8 +18,8 @@ module KubeDSL
|
|
18
18
|
|
19
19
|
def fields_to_rbi(_inflector)
|
20
20
|
[
|
21
|
-
"T::Sig::WithoutRuntime.sig { returns(#{ruby_type}) }",
|
22
|
-
"def #{ruby_safe_name}; end",
|
21
|
+
"T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.bind(#{ruby_type}).void)).returns(#{ruby_type}) }",
|
22
|
+
"def #{ruby_safe_name}(&block); end",
|
23
23
|
"",
|
24
24
|
"T::Sig::WithoutRuntime.sig { returns(T::Boolean) }",
|
25
25
|
"def #{ruby_safe_name}_present?; end"
|
data/lib/kube-dsl/rbi_helpers.rb
CHANGED
data/lib/kube-dsl/validations.rb
CHANGED
@@ -14,13 +14,13 @@ module KubeDSL
|
|
14
14
|
def value_field(field, default: nil)
|
15
15
|
__fields__[:value] << field
|
16
16
|
|
17
|
-
define_method(field) do
|
18
|
-
if
|
17
|
+
define_method(field) do |value = (value_set = true; nil)|
|
18
|
+
if value_set
|
19
|
+
instance_variable_set(:"@#{field}", value)
|
20
|
+
else
|
19
21
|
instance_variable_get(:"@#{field}") || (
|
20
22
|
default.respond_to?(:call) ? default.call(self) : default
|
21
23
|
)
|
22
|
-
else
|
23
|
-
instance_variable_set(:"@#{field}", args.first)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -29,11 +29,11 @@ module KubeDSL
|
|
29
29
|
__fields__[:object] << field
|
30
30
|
ivar = :"@#{field}"
|
31
31
|
|
32
|
-
define_method(field) do
|
32
|
+
define_method(field) do |&block|
|
33
33
|
val = instance_variable_get(ivar)
|
34
34
|
|
35
35
|
unless val
|
36
|
-
val = field_block.call
|
36
|
+
val = field_block.call
|
37
37
|
instance_variable_set(ivar, val)
|
38
38
|
end
|
39
39
|
|
data/lib/kube-dsl/version.rb
CHANGED