kuber_kit 0.7.0 → 0.7.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: d5c29f15c515fba96ece8e78533644f3a43a1d2549302599f745c676dedd47c5
4
- data.tar.gz: dccbbc6c69d0cdfbb27dfb3f9ded0bdd1efb3609f1b8ba5fe1580d4cf65ed42b
3
+ metadata.gz: 5384a7795eb49fdf9beeb9481fc03e871fb001cda72d365a646f2ca3885309e9
4
+ data.tar.gz: 229512248e019960f5f178cdd4a5c7ca99ca808d70e7286884fc152570366e73
5
5
  SHA512:
6
- metadata.gz: 110f8df5c9fa5767ee82ce03b5e482b96ba43f0394a7cc8349888df086adb663a68858fe49154c83913fc7a8be935a0494e84cf617a332f69e4553edc234024c
7
- data.tar.gz: c1800c82bb31e7b17d12b033317ebffa554eee238c66d10141603ad42817ceb314cfd12cf01b4ccc010f701e9a3424a72ed10f2ed2611c7339e9a83d5ae45821
6
+ metadata.gz: 8ab657438fc9c8463528fed4938518365abda3b944416600ad3032deff7deb8afbd2c90cca99b1fea97f9d148d2b8df77759b11a10c441fa7d7c1f672897641e
7
+ data.tar.gz: 70824969dae53951c1ac194922dc76d3773d6f65e8c51ff3589c46de9ec702d027a55ad9516e9846b81cde969c2ebab7cdb84be5f5617b216854929fd56c6bdb
data/kuber_kit.gemspec CHANGED
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- if RUBY_VERSION >= '3.0.0'
26
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
27
27
  spec.add_dependency "contracts", '0.17.0'
28
28
  else
29
29
  spec.add_dependency "contracts", '0.16.0'
30
30
  end
31
31
 
32
- if RUBY_VERSION >= '2.6.0'
32
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
33
33
  spec.add_dependency "dry-auto_inject", "~> 0.8.0"
34
34
  else
35
35
  spec.add_dependency "dry-auto_inject", "~> 0.7.0"
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency "net-ssh"
41
41
  spec.add_dependency "tty-prompt"
42
42
  spec.add_dependency "dry-container", "~> 0.7.2"
43
+ spec.add_dependency "dry-configurable", "~> 0.12.1"
43
44
 
44
45
  spec.add_development_dependency "bundler", "~> 2.2"
45
46
  spec.add_development_dependency "rake", "~> 10.0"
@@ -2,9 +2,6 @@ class KuberKit::ArtifactsSync::ArtifactUpdater
2
2
  ResolverNotFoundError = Class.new(KuberKit::NotFoundError)
3
3
 
4
4
  include KuberKit::Import[
5
- "artifacts_sync.git_artifact_resolver",
6
- "artifacts_sync.null_artifact_resolver",
7
-
8
5
  "ui"
9
6
  ]
10
7
 
@@ -19,8 +16,6 @@ class KuberKit::ArtifactsSync::ArtifactUpdater
19
16
  end
20
17
 
21
18
  def update(shell, artifact)
22
- add_default_resolvers
23
-
24
19
  resolver = @@resolvers[artifact.class]
25
20
 
26
21
  ui.print_debug "ArtifactUpdater", "Updating artifact #{artifact.name.to_s.green}"
@@ -29,13 +24,4 @@ class KuberKit::ArtifactsSync::ArtifactUpdater
29
24
 
30
25
  resolver.resolve(shell, artifact)
31
26
  end
32
-
33
- def add_default_resolvers
34
- use_resolver(git_artifact_resolver, artifact_class: KuberKit::Core::Artifacts::Git)
35
- use_resolver(null_artifact_resolver, artifact_class: KuberKit::Core::Artifacts::Local)
36
- end
37
-
38
- def reset!
39
- @@resolvers = {}
40
- end
41
27
  end
@@ -0,0 +1,32 @@
1
+ class KuberKit::Defaults
2
+ class << self
3
+ def init
4
+ return if @_initialized
5
+ @_initialized = true
6
+ init!
7
+ end
8
+
9
+ def init!
10
+ KuberKit::Container["artifacts_sync.artifact_updater"].use_resolver(
11
+ KuberKit::Container["artifacts_sync.git_artifact_resolver"],
12
+ artifact_class: KuberKit::Core::Artifacts::Git
13
+ )
14
+ KuberKit::Container["artifacts_sync.artifact_updater"].use_resolver(
15
+ KuberKit::Container["artifacts_sync.null_artifact_resolver"],
16
+ artifact_class: KuberKit::Core::Artifacts::Local
17
+ )
18
+ KuberKit::Container["env_file_reader.reader"].use_reader(
19
+ KuberKit::Container["env_file_reader.strategies.artifact_file"],
20
+ env_file_class: KuberKit::Core::EnvFiles::ArtifactFile
21
+ )
22
+ KuberKit::Container["env_file_reader.reader"].use_reader(
23
+ KuberKit::Container["env_file_reader.strategies.env_group"],
24
+ env_file_class: KuberKit::Core::EnvFiles::EnvGroup
25
+ )
26
+ KuberKit::Container["template_reader.reader"].use_reader(
27
+ KuberKit::Container["template_reader.strategies.artifact_file"],
28
+ template_class: KuberKit::Core::Templates::ArtifactFile
29
+ )
30
+ end
31
+ end
32
+ end
@@ -1,16 +1,6 @@
1
1
  class KuberKit::EnvFileReader::Reader
2
2
  ReaderNotFoundError = Class.new(KuberKit::NotFoundError)
3
-
4
- include KuberKit::Import[
5
- "env_file_reader.strategies.artifact_file",
6
- "env_file_reader.strategies.env_group",
7
- ]
8
-
9
- def initialize(**injected_deps, &block)
10
- super(**injected_deps)
11
- add_default_strategies
12
- end
13
-
3
+
14
4
  def use_reader(env_file_reader, env_file_class:)
15
5
  @@readers ||= {}
16
6
 
@@ -28,14 +18,4 @@ class KuberKit::EnvFileReader::Reader
28
18
 
29
19
  reader.read(shell, env_file)
30
20
  end
31
-
32
- def reset!
33
- @@readers = {}
34
- end
35
-
36
- private
37
- def add_default_strategies
38
- use_reader(artifact_file, env_file_class: KuberKit::Core::EnvFiles::ArtifactFile)
39
- use_reader(env_group, env_file_class: KuberKit::Core::EnvFiles::EnvGroup)
40
- end
41
21
  end
@@ -1,15 +1,6 @@
1
1
  class KuberKit::TemplateReader::Reader
2
2
  ReaderNotFoundError = Class.new(KuberKit::NotFoundError)
3
3
 
4
- include KuberKit::Import[
5
- "template_reader.strategies.artifact_file",
6
- ]
7
-
8
- def initialize(**injected_deps, &block)
9
- super(**injected_deps)
10
- add_default_strategies
11
- end
12
-
13
4
  def use_reader(template_reader, template_class:)
14
5
  @@readers ||= {}
15
6
 
@@ -27,13 +18,4 @@ class KuberKit::TemplateReader::Reader
27
18
 
28
19
  reader.read(shell, template)
29
20
  end
30
-
31
- def reset!
32
- @@readers = {}
33
- end
34
-
35
- private
36
- def add_default_strategies
37
- use_reader(artifact_file, template_class: KuberKit::Core::Templates::ArtifactFile)
38
- end
39
21
  end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
data/lib/kuber_kit.rb CHANGED
@@ -208,6 +208,7 @@ module KuberKit
208
208
  autoload :CLI, 'cli'
209
209
  autoload :Container, 'container'
210
210
  autoload :Configs, 'configs'
211
+ autoload :Defaults, 'defaults'
211
212
 
212
213
  Import = Dry::AutoInject(Container)
213
214
 
@@ -297,4 +298,6 @@ module KuberKit
297
298
  end
298
299
  end
299
300
 
301
+ KuberKit::Defaults.init
302
+
300
303
  require 'kuber_kit/extensions/indocker_compat'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-28 00:00:00.000000000 Z
11
+ date: 2021-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.7.2
111
+ - !ruby/object:Gem::Dependency
112
+ name: dry-configurable
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.12.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.12.1
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: bundler
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -280,6 +294,7 @@ files:
280
294
  - lib/kuber_kit/core/templates/abstract_template.rb
281
295
  - lib/kuber_kit/core/templates/artifact_file.rb
282
296
  - lib/kuber_kit/core/templates/template_store.rb
297
+ - lib/kuber_kit/defaults.rb
283
298
  - lib/kuber_kit/env_file_reader/action_handler.rb
284
299
  - lib/kuber_kit/env_file_reader/env_file_parser.rb
285
300
  - lib/kuber_kit/env_file_reader/env_file_tempfile_creator.rb