module Vagrant::MachineIndex::Entry::Remote::InstanceMethods
Public Class Methods
new(id, raw=nil)
click to toggle source
# File lib/vagrant/machine_index/remote.rb, line 22 def initialize(id, raw=nil) @logger = Log4r::Logger.new("vagrant::machine_index::entry") @extra_data = {} @id = id # Do nothing if we aren't given a raw value. Otherwise, parse it. return if !raw @local_data_path = raw["local_data_path"] @name = raw["name"] @provider = raw["provider"] @state = raw["state"] @full_state = raw["full_state"] @vagrantfile_name = raw["vagrantfile_name"] @vagrantfile_path = raw["vagrantfile_path"] # TODO(mitchellh): parse into a proper datetime @updated_at = raw["updated_at"] @extra_data = raw["extra_data"] || {} @machine_client = raw["machine"] # Be careful with the paths @local_data_path = nil if @local_data_path == "" @vagrantfile_path = nil if @vagrantfile_path == "" # Convert to proper types @local_data_path = Pathname.new(@local_data_path) if @local_data_path @vagrantfile_path = Pathname.new(@vagrantfile_path) if @vagrantfile_path end
Public Instance Methods
vagrant_env(home_path, opts={})
click to toggle source
# File lib/vagrant/machine_index/remote.rb, line 52 def vagrant_env(home_path, opts={}) Vagrant::Util::SilenceWarnings.silence! do Environment.new({ cwd: @vagrantfile_path, home_path: home_path, local_data_path: @local_data_path, vagrantfile_name: @vagrantfile_name, client: @machine_client&.project, }.merge(opts)) end end
valid?(home_path)
click to toggle source
# File lib/vagrant/machine_index/remote.rb, line 64 def valid?(home_path) # Always return true true end