thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

Multiple platforms with different versions of the same gem #141

Closed brendon closed 6 years ago

brendon commented 6 years ago

It doesn't seem like this is currently possible:

gem "pg", "~> 1.0.0", platform: :mri
gem "pg", "~> 0.21.0", platform: :rbx

In this example, pg has dropped support for Rubinius as of version 1.0.0 so we need to pin to an earlier version on that platform. Appraisals just ends up adding the last line in to the appraisal Gemfile treating it like an overwrite.

nickcharlton commented 6 years ago

Ah hah! I think you're right and we've not supported this so far.

Would you be interested in contributing a PR for this?

brendon commented 6 years ago

I sure would! If you could quickly point me to the relevant areas of the code where overrides occur?

nickcharlton commented 6 years ago

🎉

I think much of where you'd be looking into would be in Appraisal::BundlerDSL., which in this case is called through it's Gemfile subclass …as that's what we're really building.

I fear I can't be more helpful at this point, as I've been dipping in and out of appraisal and haven't for a while. But if you have specific questions I'm certainly happy to help you out!

brendon commented 6 years ago

Lol turns out this isn't even a thing:

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: pg (~> 0.21.0) and pg (~> 1.0.0). Bundler cannot continue.

Wishful thinking on my part. Abandon ship!!!1 💥