Understanding Vagrant plugins
Vagrant provides many options and features, but when you require something that isn't available, you can extend this functionality in the form of a plugin. Vagrant provides a powerful and robust internal API that is easy to use and flexible to develop with. Vagrant actually uses its own API for many core features.
The anatomy of a Vagrant plugin
There are multiple parts of a Vagrant plugin. Some parts are for development and others are for the general use of the plugin. We'll focus on two core elements: gem and bundler.
Gem
A gem is a specific file written in Ruby that uses the .gem
file extension. A gem is made up of three parts: the code that includes the logic, tests, and utilities; documentation; and a gemspec that includes information about the author and other metadata. The gem file is the core part of the Vagrant plugin and is the code that is run when you use the plugin in your Vagrant machine.
bundler
bundler is an application that Vagrant uses and interfaces...