Sha256: 0e23cf6ca7c0abfeae2b74d6aebd1bbccbd95879c4a39f6e8b7f9880394af8a9
Contents?: true
Size: 834 Bytes
Versions: 36
Compression:
Stored size: 834 Bytes
Contents
class KuberKit::ArtifactsSync::ArtifactUpdater ResolverNotFoundError = Class.new(KuberKit::NotFoundError) include KuberKit::Import[ "ui" ] def use_resolver(artifact_resolver, artifact_class:) @@resolvers ||= {} if !artifact_resolver.is_a?(KuberKit::ArtifactsSync::AbstractArtifactResolver) raise ArgumentError.new("should be an instance of KuberKit::ArtifactsSync::AbstractArtifactResolver, got: #{artifact_resolver.inspect}") end @@resolvers[artifact_class] = artifact_resolver end def update(shell, artifact) resolver = @@resolvers[artifact.class] ui.print_debug "ArtifactUpdater", "Updating artifact #{artifact.name.to_s.green}" raise ResolverNotFoundError, "Can't find resolver for artifact #{artifact}" if resolver.nil? resolver.resolve(shell, artifact) end end
Version data entries
36 entries across 36 versions & 1 rubygems