Class: Vagrant::Hosts::Base
- Inherits:
-
Object
- Object
- Vagrant::Hosts::Base
- Defined in:
- lib/vagrant/hosts/base.rb
Overview
Interface for classes which house behavior that is specific to the host OS that is running Vagrant.
By default, Vagrant will attempt to choose the best option
for your machine, but the host may also be explicitly set
via the config.vagrant.host
parameter.
Class Method Summary collapse
-
.match? ⇒ Boolean
This returns true/false depending on if the current running system matches the host class.
-
.precedence ⇒ Object
The precedence of the host when checking for matches.
Instance Method Summary collapse
-
#initialize(ui) ⇒ Base
constructor
Initializes a new host class.
-
#nfs? ⇒ Boolean
Returns true of false denoting whether or not this host supports NFS shared folder setup.
-
#nfs_export(id, ip, folders) ⇒ Object
Exports the given hash of folders via NFS.
-
#nfs_prune(valid_ids) ⇒ Object
Prunes any NFS exports made by Vagrant which aren't in the set of valid ids given.
Constructor Details
#initialize(ui) ⇒ Base
Initializes a new host class.
The only required parameter is a UI object so that the host objects have some way to communicate with the outside world.
35 36 37 |
# File 'lib/vagrant/hosts/base.rb', line 35 def initialize(ui) @ui = ui end |
Class Method Details
.match? ⇒ Boolean
This returns true/false depending on if the current running system matches the host class.
14 15 16 |
# File 'lib/vagrant/hosts/base.rb', line 14 def self.match? nil end |
.precedence ⇒ Object
The precedence of the host when checking for matches. This is to allow certain host such as generic OS's ("Linux", "BSD", etc.) to be specified last.
The hosts with the higher numbers will be checked first.
If you're implementing a basic host, you can probably ignore this.
25 26 27 |
# File 'lib/vagrant/hosts/base.rb', line 25 def self.precedence 5 end |
Instance Method Details
#nfs? ⇒ Boolean
Returns true of false denoting whether or not this host supports NFS shared folder setup. This method ideally should verify that NFS is installed.
44 45 46 |
# File 'lib/vagrant/hosts/base.rb', line 44 def nfs? false end |
#nfs_export(id, ip, folders) ⇒ Object
Exports the given hash of folders via NFS.
54 55 |
# File 'lib/vagrant/hosts/base.rb', line 54 def nfs_export(id, ip, folders) end |
#nfs_prune(valid_ids) ⇒ Object
Prunes any NFS exports made by Vagrant which aren't in the set of valid ids given.
62 63 |
# File 'lib/vagrant/hosts/base.rb', line 62 def nfs_prune(valid_ids) end |