sophia c2d8f892ac Find type to unany objects when mapping
find_types works fine until you have a module which has the same name but different case. For example, the VagrantVmware package is HashiCorp::VagrantVMwareDesktop. All the protos are at Hashicorp::Vagrant::… So, you end up with this fun

Object.constants.select { |n| n.to_s.downcase == "hashicorp" }
=> [:HashiCorp, :Hashicorp]

So, when trying to walk down the modules to find the right type to unany to, Vagrant sometimes takes the wrong path (eg. Down the HashiCorp module instead of the Hashicorp module).

This change will keep a list of the parent modules when walking down the module list. This way if a dead end is reached then Vagrant can go a level back and keep searching for the correct class.
2022-07-26 12:22:28 -05:00

20 lines
1.4 KiB
Ruby

module VagrantPlugins
module CommandServe
module Util
autoload :Cacher, Vagrant.source_root.join("plugins/commands/serve/util/cacher").to_s
autoload :ClientSetup, Vagrant.source_root.join("plugins/commands/serve/util/client_setup").to_s
autoload :Connector, Vagrant.source_root.join("plugins/commands/serve/util/connector").to_s
autoload :DirectConversion, Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions").to_s
autoload :ExceptionTransformer, Vagrant.source_root.join("plugins/commands/serve/util/exception_transformer").to_s
autoload :FuncSpec, Vagrant.source_root.join("plugins/commands/serve/util/func_spec").to_s
autoload :HasBroker, Vagrant.source_root.join("plugins/commands/serve/util/has_broker").to_s
autoload :HasLogger, Vagrant.source_root.join("plugins/commands/serve/util/has_logger").to_s
autoload :HasMapper, Vagrant.source_root.join("plugins/commands/serve/util/has_mapper").to_s
autoload :HasSeeds, Vagrant.source_root.join("plugins/commands/serve/util/has_seeds").to_s
autoload :NamedPlugin, Vagrant.source_root.join("plugins/commands/serve/util/named_plugin").to_s
autoload :ServiceInfo, Vagrant.source_root.join("plugins/commands/serve/util/service_info").to_s
autoload :UsageTracker, Vagrant.source_root.join("plugins/commands/serve/util/usage_tracker").to_s
end
end
end