From c0304101f4145da2dc4a700af314af9b30ee07b5 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 26 Aug 2021 15:01:53 -0700 Subject: [PATCH] Add a helper utility for setting up the mapper --- plugins/commands/serve/util.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/commands/serve/util.rb b/plugins/commands/serve/util.rb index 1a6faedbb..a095163c6 100644 --- a/plugins/commands/serve/util.rb +++ b/plugins/commands/serve/util.rb @@ -31,6 +31,17 @@ module VagrantPlugins end end + module HasMapper + def mapper + @mapper + end + + def initialize(*args, **opts, &block) + @mapper = Mappers.new(broker) if respond_to?(:broker) + super + end + end + # Adds exception logging to all public instance methods module ExceptionLogger def self.prepended(klass)