Clean up from rebase

This commit is contained in:
sophia 2021-12-07 16:19:18 -06:00 committed by Paul Hinze
parent 514b4e3d89
commit b9e7d2197e
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 0 additions and 48 deletions

View File

@ -17,23 +17,6 @@ module VagrantPlugins
SDK::Communicator::Command.decode(proto.value.value)
end
end
# Build a communicator path from a FuncSpec value
class CommunicatorPathFromSpec < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::FuncSpec::Value) { |arg|
arg.type == "hashicorp.vagrant.sdk.Args.NamedPaths" &&
!arg&.value&.value.nil?
}
end
super(inputs: inputs, output: SDK::Args::NamedPaths, func: method(:converter))
end
def converter(proto)
SDK::Args::NamedPaths.decode(proto.value.value)
end
end
end
end
end

View File

@ -109,37 +109,6 @@ module VagrantPlugins
proto.list.map do |v|
mapper.map(v)
end
class StructFromSpec < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::FuncSpec::Value) { |arg|
arg.type == "google.protobuf.Struct" &&
!arg&.value&.value.nil?
}
end
super(inputs: inputs, output: Hash, func: method(:converter))
end
def converter(proto)
h = proto.value.unpack(Google::Protobuf::Struct).to_h
h.transform_keys(&:to_sym)
end
end
class KnownStringType < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::FuncSpec::Value) { |arg|
arg.value.type_url == "type.googleapis.com/google.protobuf.Value" &&
!arg&.value&.value.nil? && arg.type == "" && converter(arg).is_a?(String)
}
end
super(inputs: inputs, output: String, func: method(:converter))
end
def converter(proto)
val = proto.value.unpack(Google::Protobuf::Value)
val.to_ruby
end
end
end