Class: VagrantPlugins::Bindfs::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::Bindfs::Command
- Defined in:
- lib/vagrant-bindfs/command.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #build ⇒ Object
- #group ⇒ Object
-
#initialize(machine, options) ⇒ Command
constructor
A new instance of Command.
- #user ⇒ Object
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, ) @machine = machine = normalize_keys() @source = .delete("source-path") @destination = .delete("dest-path") @arguments = arguments_for(.merge()) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
7 8 9 |
# File 'lib/vagrant-bindfs/command.rb', line 7 def arguments @arguments end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
6 7 8 |
# File 'lib/vagrant-bindfs/command.rb', line 6 def destination @destination end |
#source ⇒ Object (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
#build ⇒ Object
18 19 20 |
# File 'lib/vagrant-bindfs/command.rb', line 18 def build [ "bindfs", arguments.join(" "), source, destination ].compact.join(" ") end |
#group ⇒ Object
26 27 28 |
# File 'lib/vagrant-bindfs/command.rb', line 26 def group @arguments.join(' ')[/--(?:force-)?group=([^\s]+)/, 1] end |
#user ⇒ Object
22 23 24 |
# File 'lib/vagrant-bindfs/command.rb', line 22 def user @arguments.join(' ')[/--(?:force-)?user=([^\s]+)/, 1] end |