Update name from Types to Type
This commit is contained in:
parent
739b490f09
commit
6bdc7baf39
@ -46,7 +46,7 @@ module VagrantPlugins
|
||||
value: any,
|
||||
)
|
||||
end
|
||||
d = Types::Direct.new(arguments: args)
|
||||
d = Type::Direct.new(arguments: args)
|
||||
da = mapper.map(d, to: Google::Protobuf::Any)
|
||||
arg_protos << SDK::FuncSpec::Value.new(
|
||||
name: "",
|
||||
|
||||
@ -99,14 +99,14 @@ module VagrantPlugins
|
||||
|
||||
def folder_proto(folders)
|
||||
folders_proto = {}
|
||||
folders.each do |k, v|
|
||||
folders.each do |k, v|
|
||||
folder_proto[k] = mapper.map(v, to: Google::Protobuf::Any)
|
||||
end
|
||||
folders_proto
|
||||
end
|
||||
|
||||
def direct_opts_proto(opts)
|
||||
direct_proto = Types::Direct.new(arguments: opts)
|
||||
direct_proto = Type::Direct.new(arguments: opts)
|
||||
mapper.map(direct_proto, to: Google::Protobuf::Any)
|
||||
end
|
||||
end
|
||||
|
||||
@ -27,7 +27,7 @@ module VagrantPlugins
|
||||
autoload :Client, Vagrant.source_root.join("plugins/commands/serve/client").to_s
|
||||
autoload :Mappers, Vagrant.source_root.join("plugins/commands/serve/mappers").to_s
|
||||
autoload :Service, Vagrant.source_root.join("plugins/commands/serve/service").to_s
|
||||
autoload :Types, Vagrant.source_root.join("plugins/commands/serve/types").to_s
|
||||
autoload :Type, Vagrant.source_root.join("plugins/commands/serve/type").to_s
|
||||
autoload :Util, Vagrant.source_root.join("plugins/commands/serve/util").to_s
|
||||
|
||||
class Command < Vagrant.plugin("2", :command)
|
||||
|
||||
@ -7,7 +7,7 @@ module VagrantPlugins
|
||||
class Mappers
|
||||
DEFAULT_MAPS = {
|
||||
SDK::Args::Array => Array,
|
||||
SDK::Args::Direct => Types::Direct,
|
||||
SDK::Args::Direct => Type::Direct,
|
||||
SDK::Args::Guest => Client::Guest,
|
||||
SDK::Args::Hash => Hash,
|
||||
SDK::Args::Host => Client::Host,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
require "pp"
|
||||
require "google/protobuf/well_known_types"
|
||||
require "google/protobuf/wrappers_pb"
|
||||
|
||||
@ -29,7 +30,7 @@ module VagrantPlugins
|
||||
Input.new(type: SDK::Args::Direct),
|
||||
Input.new(type: Mappers),
|
||||
],
|
||||
output: Types::Direct,
|
||||
output: Type::Direct,
|
||||
func: method(:converter),
|
||||
)
|
||||
end
|
||||
@ -39,7 +40,7 @@ module VagrantPlugins
|
||||
logger.debug("converting direct argument #{v} to something useful")
|
||||
mappers.map(v)
|
||||
end
|
||||
Types::Direct.new(arguments: args)
|
||||
Type::Direct.new(arguments: args)
|
||||
end
|
||||
end
|
||||
|
||||
@ -48,7 +49,7 @@ module VagrantPlugins
|
||||
|
||||
def initialize
|
||||
inputs = [].tap do |i|
|
||||
i << Input.new(type: Types::Direct)
|
||||
i << Input.new(type: Type::Direct)
|
||||
i << Input.new(type: Mappers)
|
||||
end
|
||||
super(inputs: inputs, output: SDK::Args::Direct, func: method(:converter))
|
||||
@ -57,7 +58,7 @@ module VagrantPlugins
|
||||
def converter(d, mappers)
|
||||
args = d.args.map do |a|
|
||||
begin
|
||||
logger.debug("direct argument list item map to any: #{a}")
|
||||
logger.debug("direct argument list item map to any: #{a.pretty_inspect}")
|
||||
mappers.map(a, to: Google::Protobuf::Any)
|
||||
rescue => err
|
||||
raise "Failed to map value #{a} - #{err}\n#{err.backtrace.join("\n")}"
|
||||
|
||||
@ -90,7 +90,7 @@ module VagrantPlugins
|
||||
|
||||
args = mapper.funcspec_map(
|
||||
req.func_args,
|
||||
expect: default_args.keys + [Types::Direct]
|
||||
expect: default_args.keys + [Type::Direct]
|
||||
)
|
||||
args = capability_arguments(args)
|
||||
cap_method = target_cap.method(cap_name)
|
||||
|
||||
@ -79,7 +79,7 @@ module VagrantPlugins
|
||||
plugin_name = info.plugin_name
|
||||
machine, folders, opts = mapper.funcspec_map(
|
||||
req.func_args,
|
||||
expect: [Vagrant::Machine, Hash, Types::Direct]
|
||||
expect: [Vagrant::Machine, Hash, Type::Direct]
|
||||
)
|
||||
|
||||
sf = get_synced_folder_plugin(plugin_name)
|
||||
@ -113,7 +113,7 @@ module VagrantPlugins
|
||||
plugin_name = info.plugin_name
|
||||
machine, folders, opts = mapper.funcspec_map(
|
||||
req.func_args,
|
||||
expect: [Vagrant::Machine, Hash, Types::Direct]
|
||||
expect: [Vagrant::Machine, Hash, Type::Direct]
|
||||
)
|
||||
|
||||
sf = get_synced_folder_plugin(plugin_name)
|
||||
@ -143,7 +143,7 @@ module VagrantPlugins
|
||||
plugin_name = info.plugin_name
|
||||
machine, opts = mapper.funcspec_map(
|
||||
req.func_args,
|
||||
expect: [Vagrant::Machine, Types::Direct]
|
||||
expect: [Vagrant::Machine, Type::Direct]
|
||||
)
|
||||
|
||||
sf = get_synced_folder_plugin(plugin_name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user