forked from hashicorp/vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin development
jimmycuadra edited this page Mar 15, 2013
·
2 revisions
Vagrant checks installed gems for a file in its root lib path called vagrant_init.rb and requires it, if present.
Require "vagrant" inside your plugin gem. Then create a class that inherits from the dynamically determined plugin base class:
class MyPlugin < Vagrant.plugin(2)
name "My Plugin"
endThe call to name will both name the plugin and register it with Vagrant's global plugin manager.
When a user runs vagrant plugin install <YOUR_PLUGIN>, your plugin gem is added to ~/.vagrant.d/plugins.json. This file is checked when Vagrant runs to determine which plugins to activate.