hosts/*: proper detect API

This commit is contained in:
Mitchell Hashimoto 2014-01-07 21:18:36 -08:00
parent 5f832467b3
commit e9f6c81ab7
8 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@ module Vagrant
# matches the host class.
#
# @return [Boolean]
def detect?
def detect?(env)
false
end
end

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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?

View File

@ -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

View File

@ -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