hosts/*: proper detect API
This commit is contained in:
parent
5f832467b3
commit
e9f6c81ab7
|
@ -10,7 +10,7 @@ module Vagrant
|
|||
# matches the host class.
|
||||
#
|
||||
# @return [Boolean]
|
||||
def detect?
|
||||
def detect?(env)
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'vagrant/util/platform'
|
|||
module VagrantPlugins
|
||||
module HostFreeBSD
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
Vagrant::Util::Platform.freebsd?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require "vagrant"
|
|||
module VagrantPlugins
|
||||
module HostGentoo
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
File.exists?("/etc/gentoo-release")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ module VagrantPlugins
|
|||
module HostLinux
|
||||
# Represents a Linux based host, such as Ubuntu.
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
Vagrant::Util::Platform.linux?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ require "vagrant"
|
|||
module VagrantPlugins
|
||||
module HostOpenSUSE
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
release_file = Pathname.new("/etc/SuSE-release")
|
||||
|
||||
if release_file.exist?
|
||||
|
|
|
@ -5,7 +5,7 @@ require "vagrant"
|
|||
module VagrantPlugins
|
||||
module HostRedHat
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
release_file = Pathname.new("/etc/redhat-release")
|
||||
|
||||
if release_file.exist?
|
||||
|
|
|
@ -3,7 +3,7 @@ require "vagrant"
|
|||
module VagrantPlugins
|
||||
module HostSlackware
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
return File.exists?("/etc/slackware-release") ||
|
||||
!Dir.glob("/usr/lib/setup/Plamo-*").empty?
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ require 'vagrant/util/platform'
|
|||
module VagrantPlugins
|
||||
module HostWindows
|
||||
class Host < Vagrant.plugin("2", :host)
|
||||
def self.detect?(env)
|
||||
def detect?(env)
|
||||
Vagrant::Util::Platform.windows?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue