From 44afa299f085433c9aa6d3bf43510e9e85ec4b22 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 13 Jun 2022 17:04:33 -0700 Subject: [PATCH] Perform direct type conversions --- plugins/commands/serve/client/project.rb | 4 ++++ plugins/commands/serve/client/target.rb | 12 +++++++++++- plugins/commands/serve/client/terminal.rb | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/commands/serve/client/project.rb b/plugins/commands/serve/client/project.rb index a559c75f8..5a224580c 100644 --- a/plugins/commands/serve/client/project.rb +++ b/plugins/commands/serve/client/project.rb @@ -156,6 +156,10 @@ module VagrantPlugins resp.path end + def vagrantfile + client.vagrantfile(Empty.new).to_ruby + end + # @return [String] name of the Vagrantfile for this target def vagrantfile_name client.vagrantfile_name(Empty.new).name diff --git a/plugins/commands/serve/client/target.rb b/plugins/commands/serve/client/target.rb index 08ae6dd4e..d81297136 100644 --- a/plugins/commands/serve/client/target.rb +++ b/plugins/commands/serve/client/target.rb @@ -13,7 +13,13 @@ module VagrantPlugins :DESTROYED, ].freeze - # @return [Hashicorp::Vagrant::Sdk::Ref::Target] proto reference for this target + + # @return [SDK::Ref::Target] proto reference for this target + def vagrantfile + client.vagrantfile(Empty.new).to_ruby + end + + # @return [SDK::Ref::Target] proto reference for this target def ref SDK::Ref::Target.new(resource_id: resource_id) end @@ -61,6 +67,10 @@ module VagrantPlugins Project.load(client.project(Empty.new), broker: broker) end + def environment + client.project(Empty.new).to_ruby + end + # @return [Provider] provider for target def provider client.provider(Empty.new) diff --git a/plugins/commands/serve/client/terminal.rb b/plugins/commands/serve/client/terminal.rb index 2e8646298..8873bdb44 100644 --- a/plugins/commands/serve/client/terminal.rb +++ b/plugins/commands/serve/client/terminal.rb @@ -106,6 +106,10 @@ module VagrantPlugins end } end + + def to_ui + Vagrant::UI::Remote.new(self) + end end end end