kube-dsl 0.7.0 → 0.7.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
  SHA256:
3
- metadata.gz: 641c36c885caa0297fecc54a22de1dcd4a79d1f90eb7be9856eaeb185c2bf817
4
- data.tar.gz: 4b79ad723e0a1554dd42abacca6a21cea294ac6b78925939b1b24eeca955cfed
3
+ metadata.gz: cb88313ad58e1c157f40b21c8c6ee88b6ed522fd781f3a4565e6a9d75b4d59c0
4
+ data.tar.gz: 2d6f7e9ed3506746869b31463a1cf5c1647762e47c0e16cb6d354e668dc935ef
5
5
  SHA512:
6
- metadata.gz: 228bf0eb5b9155a59bf7eaa044a0c457b6d396fd1b9827f9bca6e2dc3e767464c553d6b240939a1f93a33be5012a4a63bd42817bb5e37dfff8c8c112e77143ec
7
- data.tar.gz: 899dd22a29b9393aa71bdf043f52cfbb72444519e1c2372154363d46ebd8ac86478ff2e85fb319dadc3b9be31d0dfa241a372503b9af3230e98aa5f5017367df
6
+ metadata.gz: dd4fa0c8998d5d519c6dd7989c230f8d57f6fe0bb213e8efd54c7379498f84760fa5478e51d3a796f3a241edfe4847f8b680506359227f186c2ddd713cf90673
7
+ data.tar.gz: b11c7054dc2a394e13994ab0749b839927ac59d486c4e991d136adb82ec11f57392bbbc054756e7cdfbb40f8d20012ac7ce9316a67bc614d094bccc6407834c6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.7.3
2
+ * Add feature to limit the length of filenames to 100 characters.
3
+ - Rubygems has a hard limit on the number of characters allowed in a filename, which I assume is actually a requirement of whatever archive format it uses.
4
+
5
+ ## 0.7.2
6
+ * Use tapioca for type annotations.
7
+ * Fix a couple of type annotations.
8
+
9
+ ## 0.7.1
10
+ * Remove dependency on the defunct sorbet-runtime-stub gem.
11
+
1
12
  ## 0.7.0
2
13
  * Upgrade to v1.22 of the Kubernetes schema.
3
14
  * Add Sorbet type signatures to all DSL objects.
data/Gemfile CHANGED
@@ -9,8 +9,9 @@ end
9
9
 
10
10
  group :development do
11
11
  # lock to a specific version to prevent breaking CI when new versions come out
12
- gem 'sorbet', '= 0.5.6433'
13
- gem 'parlour', '~> 6.0'
12
+ gem 'sorbet'
13
+ gem 'tapioca', '~> 0.7'
14
+ gem 'parlour', github: 'camertron/parlour', branch: 'initialize_void' # '~> 7.0'
14
15
  end
15
16
 
16
17
  group :test do
data/Rakefile CHANGED
@@ -54,7 +54,6 @@ task :generate do
54
54
  )
55
55
 
56
56
  generator.generate_resource_files
57
- generator.generate_rbi_files
58
57
  generator.generate_autoload_files
59
58
  generator.generate_entrypoint_file do |resource, ns|
60
59
  version = resource.ref.version || ''
data/kube-dsl.gemspec CHANGED
@@ -11,7 +11,6 @@ Gem::Specification.new do |s|
11
11
  s.description = s.summary = 'A Ruby DSL for defining Kubernetes resources.'
12
12
 
13
13
  s.add_dependency 'dry-inflector', '~> 0.2'
14
- s.add_dependency 'sorbet-runtime-stub', '~> 0.2'
15
14
 
16
15
  s.require_path = 'lib'
17
16
  s.files = Dir['{lib,spec,rbi}/**/*', 'Gemfile', 'LICENSE', 'CHANGELOG.md', 'README.md', 'Rakefile', 'kube-dsl.gemspec']
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class AllowBlank
3
4
  attr_reader :value
@@ -22,7 +22,7 @@ module KubeDSL
22
22
  validates :run_as_user, field: { format: :integer }, presence: false
23
23
  validates :se_linux_options, object: { kind_of: KubeDSL::DSL::V1::SELinuxOptions }
24
24
  validates :seccomp_profile, object: { kind_of: KubeDSL::DSL::V1::SeccompProfile }
25
- validates :supplemental_groups, field: { format: :string }, presence: false
25
+ validates :supplemental_groups, field: { format: :integer }, presence: false
26
26
  validates :sysctlses, array: { kind_of: KubeDSL::DSL::V1::Sysctl }, presence: false
27
27
  validates :windows_options, object: { kind_of: KubeDSL::DSL::V1::WindowsSecurityContextOptions }
28
28
 
@@ -49,9 +49,18 @@ module KubeDSL
49
49
  [autoload_prefix].tap do |path|
50
50
  path << underscore(namespace) if namespace
51
51
  path << underscore(version) if version
52
- path << "#{underscore(kind)}.rb"
52
+ path << shorten("#{underscore(kind)}.rb")
53
53
  end
54
54
  )
55
55
  end
56
+
57
+ def shorten(filename)
58
+ return filename if filename.size <= 100
59
+
60
+ digest = Digest::MD5.hexdigest(filename)[0...8]
61
+ extname = File.extname(filename)
62
+
63
+ "#{filename.chomp(extname)[0...(100 - extname.size - digest.size - 1)]}_#{digest}#{extname}"
64
+ end
56
65
  end
57
66
  end
@@ -19,7 +19,10 @@ module KubeDSL
19
19
  def fields_to_rbi(_inflector)
20
20
  [
21
21
  "T::Sig::WithoutRuntime.sig { returns(#{ruby_type}) }",
22
- "def #{ruby_safe_name}; end"
22
+ "def #{ruby_safe_name}; end",
23
+ "",
24
+ "T::Sig::WithoutRuntime.sig { returns(T::Boolean) }",
25
+ "def #{ruby_safe_name}_present?; end"
23
26
  ]
24
27
  end
25
28
 
@@ -22,7 +22,7 @@ module KubeDSL
22
22
  YAML.dump(serialize)
23
23
  end
24
24
 
25
- T::Sig::WithoutRuntime.sig { returns(Resource) }
25
+ T::Sig::WithoutRuntime.sig { returns(KubeDSL::Resource) }
26
26
  def to_resource
27
27
  self
28
28
  end
@@ -58,6 +58,10 @@ module KubeDSL
58
58
  indent("module #{mod}", idx)
59
59
  end,
60
60
  *indent("class #{ref.kind} < ::KubeDSL::DSLObject", level + 1),
61
+ *indent("extend KubeDSL::ValueFields::ClassMethods", level + 2),
62
+ *indent("extend KubeDSL::Validations::ClassMethods", level + 2),
63
+ *indent("include KubeDSL::ValueFields::InstanceMethods", level + 2),
64
+ '',
61
65
  *indent(
62
66
  'T::Sig::WithoutRuntime.sig {',
63
67
  ' returns(',
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: true
2
2
 
3
3
  module KubeDSL
4
4
  class SerializeHandler
@@ -1,4 +1,5 @@
1
1
  # typed: strict
2
+
2
3
  module KubeDSL
3
- VERSION = '0.7.0'
4
+ VERSION = '0.7.3'
4
5
  end