From c4da3b0cbd9fedea9c430b36886a913b190d6b33 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 6 Oct 2021 08:33:38 -0700 Subject: [PATCH] Rename capabilities mapper and convert to symbol --- .../serve/mappers/{capability.rb => capabilities.rb} | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename plugins/commands/serve/mappers/{capability.rb => capabilities.rb} (61%) diff --git a/plugins/commands/serve/mappers/capability.rb b/plugins/commands/serve/mappers/capabilities.rb similarity index 61% rename from plugins/commands/serve/mappers/capability.rb rename to plugins/commands/serve/mappers/capabilities.rb index f7172c76e..40c4c2ae1 100644 --- a/plugins/commands/serve/mappers/capability.rb +++ b/plugins/commands/serve/mappers/capabilities.rb @@ -1,8 +1,8 @@ module VagrantPlugins module CommandServe class Mappers - # Extracts a string capability name from a Funcspec value - class NamedCapability < Mapper + # Build a machine client from a FuncSpec value + class NamedCapabilityFromSpec < Mapper def initialize inputs = [].tap do |i| i << Input.new(type: SDK::FuncSpec::Value) { |arg| @@ -10,11 +10,12 @@ module VagrantPlugins !arg&.value&.value.nil? } end - super(inputs: inputs, output: String, func: method(:converter)) + super(inputs: inputs, output: Symbol, func: method(:converter)) end def converter(proto) - SDK::Args::NamedCapability.decode(proto.value.value).capability + SDK::Args::NamedCapability.load(proto.value.value). + capability.to_s.to_sym end end end