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(env, options) ⇒ Command
constructor
A new instance of Command.
- #user ⇒ Object
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, ) @env = env @machine = env[: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
19 20 21 |
# File 'lib/vagrant-bindfs/command.rb', line 19 def build [ "bindfs", arguments.join(" "), source, destination ].compact.join(" ") end |
#group ⇒ Object
27 28 29 |
# File 'lib/vagrant-bindfs/command.rb', line 27 def group @arguments.join(' ')[/--(?:force-)?group=([^\s]+)/, 1] end |
#user ⇒ Object
23 24 25 |
# File 'lib/vagrant-bindfs/command.rb', line 23 def user @arguments.join(' ')[/--(?:force-)?user=([^\s]+)/, 1] end |