thoughtbot / appraisal

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

(#170) Add ability to remove gem from appraisal #171

Closed jebentier closed 3 years ago

jebentier commented 4 years ago

Purpose of PR

This is adding the ability to use the remove_gem declaration within an appraise block. By doing so the gem will be dropped from the generated Gemfile. This is useful in cases where an appraisal require the removal of old dependencies that are still used by the mainline source.

Example Usage

Gemfile

gem 'rails', '~> 4.2'

group :test do
  gem 'rspec', '~> 4.0'
  gem 'test_after_commit'
end

Appraisals

appraise 'rails-5' do
  gem 'rails', '~> 5.2'

  group :test do
    remove_gem 'test_after_commit'
  end
end

To produce: gemfiles/rails_5.gemfile

gem 'rails', '~> 5.2'

group :test do
  gem 'rspec', '~> 4.0'
end

Fixes #170

jebentier commented 3 years ago

@composerinteralia I've gone ahead and made the suggested edits to the new contract and updated the PR to reflect those changes.

@nickcharlton I've gone ahead and updated the README to include documentation for this new declaration

jebentier commented 3 years ago

@composerinteralia would you have some time to re-review this in the coming days? I’m looking forward to getting this feature out so that we can use it at my company. If there’s anything that I can do to help with the release management of the gem as well, just let me know and I’d be happy to help.

nickcharlton commented 3 years ago

Hi @jebentier! Sorry, that's on me. I was meaning to go ahead and merge this but it turned into a fairly busy week.

I'm going to merge this now and I'll take a look at doing a new release some time before this Friday. Thanks for your contribution!

jebentier commented 3 years ago

@nickcharlton no worries at all, it’s been rather busy here as well. Thank you for accepting this contribution.

jebentier commented 3 years ago

@nickcharlton any update on getting this released?

ColinDKelley commented 3 years ago

@nickcharlton Any update on the release that will include this PR? It seems especially important since master has been documenting this new feature for 2 months now.

ColinDKelley commented 3 years ago

@nickcharlton Any update on the release that will include this PR?

nickcharlton commented 3 years ago

Thanks for your patience everyone — I just did this now and so you should see version 2.4.0 available now.