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(env, options) ⇒ Command

Returns a new instance of Command.



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

def initialize(env, options)
  @env     = env
  @machine = env[: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



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

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

#groupObject



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

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

#userObject



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

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