-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Appraisal doesn't support gemspec inside group #76
Comments
Thanks for an awesome bug report. I think we should fix both of this to make them work. For (1), we'll add support for For (2), we do have relativize task, but I don't think I have a case where the |
FYI - I was reading thru the bundler code and found that the implementation of the DSL is "flat", not "hierarchical" like I would have assumed and appraisal seems to be. What I mean is that methods that take a block (group, platform, and env - not sure what env does) do not change the scope. Bundler doesn't yield the block to a group, it just stores the group name (for later option normalization) and then yields the block to itself - the top-level DSL. See:
So basically this: gem "appraisal"
group :plugins do
gem "vagrant-rackspace", path: "."
end Is normalized and evaluated like this: gem "appraisal", :groups => :default
gem "vagrant-rackspace", :groups => :plugins I imagine you probably don't want to do quite the same in Appraisal - you want to generate gemfiles that are maintain a structure similar to the original Gemfile rather than normalizing them - but the point is that all DSL methods should be supported inside any block, not just specifically gemspec within group. |
Right. If I could make it flat like Bundler, it would definitely be easier to read. However, we want to maintain the hierarchy, so that's why it's a bit more complex. >_> |
I've extracted the |
Overview
Although Appraisal does support gemspec (#48) and other Bundler DSL methods, there are some discrepancies in where the gemspec method is allowed.
I'd like to use Appraisal to test a vagrant plugin against multiple releases of Vagrant. Vagrant and Vagrant plugins are just gems, but Vagrant plugin development follows less common Gemfile conventions that don't seem to work with Appraisal.
Background
This is a brief explanation of how Vagrant and Vagrant plugin installs work, and why that's resulted in unusual Gemfile conventions. If you don't care why Vagrant plugins use special bundler groups than you can skip to the next section. Nothing in this section needs to be supported by Appraisal.
Vagrant is no longer distributed via RubyGems. Instead, it's distributed via native package installers that include an embedded Ruby, so Vagrant has more control over non-Ruby dependencies (e.g. Virtualbox) and is easy to install for non-Ruby users. This also means plugins are installed to the embedded ruby with
vagrant plugin install
rather thangem install
orbundle install
.The result is that Gemfiles for Vagrant development follow different conventions than many Ruby projects:
vagrant plugin install
.Examples
Appraisals file
I would like to use these Appraisals:
That will test my plugin the last several releases of Vagrant, as well as a fork where new features are being added for Windows.
Appraisal actually overrides the vagrant dependencies properly. It has an issue with the gem under development.
Approach 1 - gemspec
This is what I have in my Gemfile:
This doesn't work, because although Appraisal handles the gemspec method it doesn't seem to allow it within a group:
Approach 2 - gem with path
Alternately, the vagrant plugin development guide uses
gem "my-plugin", path: "."
instead ofgemspec
.This doesn't work either, probably because support for rewriting path wasn't completed/merged (#19). The result:
The text was updated successfully, but these errors were encountered: