Sha256: 75eafcb261321949aa31e39085c00a57fcfc10fc2e8a2ed92a0563da51b8065f

Contents?: true

Size: 654 Bytes

Versions: 1

Compression:

Stored size: 654 Bytes

Contents

require 'vagrant'
require 'vagrant-hosts/provisioner'

module VagrantHosts
class Provisioner
module Hostname
  # Abstract the details of setting a guest hostname on different versions of
  # Vagrant.
  #
  # Vagrant commit 61d2f9f96fc0f0ef5869c732674f25c4ccc85c8c converts the
  # #change_host_name # method to a capability, which breaks the API between
  # 1.1 and 1.2. :(

  # @param name [String] The new hostname to apply on the guest
  def change_host_name(name)
    case Vagrant::VERSION
    when /1\.1/
      @machine.guest.change_host_name(name)
    when /1\.2/
      @machine.guest.capability(:change_host_name, name)
    end
  end

end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-hosts-1.1.0 lib/vagrant-hosts/provisioner/hostname.rb