Sha256: a92f0f09599636f5350f24a57207a71b0a55a46c67c3c569a07f7a60de784a54

Contents?: true

Size: 728 Bytes

Versions: 6

Compression:

Stored size: 728 Bytes

Contents

module VagrantPlugins
  module GuestLinux
    module Cap
      class ShellExpandGuestPath
        def self.shell_expand_guest_path(machine, path)
          real_path = nil
          machine.communicate.execute("printf #{path}") do |type, data|
            if type == :stdout
              real_path ||= ""
              real_path += data
            end
          end

          if !real_path
            # If no real guest path was detected, this is really strange
            # and we raise an exception because this is a bug.
            raise LinuxShellExpandFailed
          end

          # Chomp the string so that any trailing newlines are killed
          return real_path.chomp
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/guests/linux/cap/shell_expand_guest_path.rb
tnargav-1.2.3 plugins/guests/linux/cap/shell_expand_guest_path.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/guests/linux/cap/shell_expand_guest_path.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/guests/linux/cap/shell_expand_guest_path.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/guests/linux/cap/shell_expand_guest_path.rb
tnargav-1.2.2 plugins/guests/linux/cap/shell_expand_guest_path.rb