Sha256: 6329d1b68fd1b29ad3117a9ec508417931a4394179a5798095f0d789f451639e

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

# Vagrant shared folder model.
#
# @see http://docs.vagrantup.com/v2/synced-folders/index.html
class ConfigBuilder::Model::SyncedFolder < ConfigBuilder::Model::Base

  # @!attribute [rw] host_path
  #   @return [String] The host file path to mount on the guest
  def_model_attribute :host_path

  # @!attribute [rw] guest_path
  #   @return [String] The guest file path to be used as the mount point
  def_model_attribute :guest_path

  # @!attribute [rw] extra
  #   A set of arbitrary options to pass to the virtualbox mount command.
  #   @return [String]
  def_model_attribute :extra

  # @!attribute [rw] disabled
  #   @return [Boolean] If the mount point should be disabled.
  def_model_attribute :disabled

  # @!attribute [rw] nfs
  #   @return [Boolean] If the mount point should use NFS
  def_model_attribute :nfs

  def to_proc
    Proc.new do |vm_config|
      vm_config.synced_folder(attr(:host_path), attr(:guest_path), folder_opts)
    end
  end

  private

  def folder_opts
    h = {}
    with_attr(:extra)   { |val| h[:extra]    = val }
    with_attr(:disable) { |val| h[:disabled] = val }
    with_attr(:nfs)     { |val| h[:nfs]      = val }

    h
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-config_builder-0.10.1 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.10.0 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.9.0 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.8.0 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.7.1 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.7.0 lib/config_builder/model/synced_folder.rb
vagrant-config_builder-0.6.0 lib/config_builder/model/synced_folder.rb