mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-03-02 21:30:49 -05:00
22 lines
655 B
Ruby
22 lines
655 B
Ruby
module VagrantPlugins
|
|
module CommandServe
|
|
class Mappers
|
|
# Build a command arguments from a FuncSpec value
|
|
class CommandArgumentsFromSpec < Mapper
|
|
def initialize
|
|
inputs = [].tap do |i|
|
|
i << Input.new(type: SDK::FuncSpec::Value) { |arg|
|
|
arg.type == "hashicorp.vagrant.sdk.Command.Arguments" &&
|
|
!arg&.value&.value.nil?
|
|
}
|
|
end
|
|
super(inputs: inputs, output: SDK::Command::Arguments, func: method(:converter))
|
|
end
|
|
|
|
def converter(proto)
|
|
SDK::Command::Arguments.decode(proto.value.value)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|