Class: VagrantPlugins::Bindfs::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-bindfs/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, options) ⇒ Command

Returns a new instance of Command.



9
10
11
12
13
14
15
16
# File 'lib/vagrant-bindfs/command.rb', line 9

def initialize(machine, options)
  @machine = machine
  options  = normalize_keys(options)

  @source       = options.delete("source-path")
  @destination  = options.delete("dest-path")
  @arguments    = arguments_for(default_options.merge(options))
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



7
8
9
# File 'lib/vagrant-bindfs/command.rb', line 7

def arguments
  @arguments
end

#destinationObject (readonly)

Returns the value of attribute destination.



6
7
8
# File 'lib/vagrant-bindfs/command.rb', line 6

def destination
  @destination
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/vagrant-bindfs/command.rb', line 5

def source
  @source
end

Instance Method Details

#buildObject



18
19
20
# File 'lib/vagrant-bindfs/command.rb', line 18

def build
  [ "bindfs", arguments.join(" "), source, destination ].compact.join(" ")
end

#groupObject



26
27
28
# File 'lib/vagrant-bindfs/command.rb', line 26

def group
  @arguments.join(' ')[/--(?:force-)?group=([^\s]+)/, 1]
end

#userObject



22
23
24
# File 'lib/vagrant-bindfs/command.rb', line 22

def user
  @arguments.join(' ')[/--(?:force-)?user=([^\s]+)/, 1]
end