-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Vagrant.require_plugin('bar', '1.0') #2598
Conversation
So, I added a version parameter to require_plugin, hoping to add support to load/enforce a specific version of a plugin when this is used in a Vagrantfile. Right now struggling to write a proper unit or acceptance test for it since I seem to be unable to install plugins on the fly or within a bundler environment. Feedback welcome.
What if it it would accept (a list of) Gem requirement string, for example The code would be something like: if !Gem::Requirement.new(version).satisfied_by?(Gem::Version.new(plugin_version)) |
Ooo I like the idea of a Gem requirement string. It's already a standard and it's super-flexible. |
@till let me see if I can work a test out with some stubbing action. I'm also experimenting to see if |
So here is what I came up with: phinze@cdcb630 Couple of things I figured out playing with it:
@till Do you want me to re-PR with my revisions, you want to make your own edits, or you want to discuss here more? I'm down for whatever! ⏬ |
I didn't even know about But you won't have multiple gem/plugin versions installed with Vagrant. The |
Ooo well I didn't know about Hmm, if only one version of a plugin can be installed at any one time, it may be cleaner to do something closer to your strategy. @till - I'll send you a PR with what I'm thinking. |
- use a rubygems version specification - add a test - raise a specific error
Alright PR'd at easybiblabs#1 |
…ersion core: tweaks require_plugin version
👍 LGTM |
LGTM |
Hold off on merging this for a second. I want to think further about plugin dependency management. |
@mitchellh HNY — that was a long second. Any thoughts? |
@till Yes I'm actually going through this now. It is a difficult problem. I'm trying to actually solve the entire dependency resolution problem of plugins in their entirety. |
This won't be necessary anymore with the Plugins are now loaded all at once at the beginning of Vagrant. So we'll need another method to describe the requirements. But either way, this won't work here. |
So, I added a version parameter to require_plugin, hoping to add support to load/enforce
a specific version of a plugin when this is used in a Vagrantfile.
Right now struggling to write a proper unit or acceptance test for it since I seem to be
unable to install plugins on the fly or within a bundler environment.
Feedback welcome.