Module: VagrantBindfs::Vagrant::Capabilities

Included in:
Plugin
Defined in:
lib/vagrant-bindfs/vagrant/capabilities.rb,
lib/vagrant-bindfs/vagrant/capabilities/all.rb,
lib/vagrant-bindfs/vagrant/capabilities/suse.rb,
lib/vagrant-bindfs/vagrant/capabilities/linux.rb,
lib/vagrant-bindfs/vagrant/capabilities/darwin.rb,
lib/vagrant-bindfs/vagrant/capabilities/debian.rb,
lib/vagrant-bindfs/vagrant/capabilities/gentoo.rb,
lib/vagrant-bindfs/vagrant/capabilities/redhat.rb,
lib/vagrant-bindfs/vagrant/capabilities/ubuntu.rb,
lib/vagrant-bindfs/vagrant/capabilities/suse/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/all/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/linux/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/darwin/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/debian/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/gentoo/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/redhat/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/suse/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/ubuntu/fuse.rb,
lib/vagrant-bindfs/vagrant/capabilities/darwin/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/debian/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/gentoo/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/redhat/bindfs.rb,
lib/vagrant-bindfs/vagrant/capabilities/all/system_checks.rb,
lib/vagrant-bindfs/vagrant/capabilities/all/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/linux/system_checks.rb,
lib/vagrant-bindfs/vagrant/capabilities/darwin/system_checks.rb,
lib/vagrant-bindfs/vagrant/capabilities/suse/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/linux/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/darwin/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/debian/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/gentoo/package_manager.rb,
lib/vagrant-bindfs/vagrant/capabilities/redhat/package_manager.rb

Overview

:nodoc:

Defined Under Namespace

Modules: All, Darwin, Debian, Gentoo, Linux, RedHat, Suse, Ubuntu

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-bindfs/vagrant/capabilities.rb', line 21

def included(base)
  capabilities = JSON.parse(File.read(File.expand_path('capabilities.json', __dir__)))
  capabilities.each do |cap_name, oses|
    oses.each do |os_name, module_name|
      mod = module_by_name(module_name)
      base.guest_capability(os_name.to_s, cap_name.to_s) { mod }
    end
  end
end

.module_by_name(camel_cased_word) ⇒ Object



31
32
33
# File 'lib/vagrant-bindfs/vagrant/capabilities.rb', line 31

def module_by_name(camel_cased_word)
  camel_cased_word.split('::').inject(self) { |constant, name| constant.const_get(name) }
end