Skip to content
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

Remove conditions from gem declarations in Gemfile #584

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

larskanis
Copy link
Contributor

@larskanis larskanis commented Aug 5, 2024

Both gems 'wdm' and 'rb-kqueue' can be installed on any platform. They fail when require 'wdm' or 'rb-kqueue' is called. So the conditions in the Gemfile can be removed and should not be recommended.

Having conditions in the Gemfile is generally bad practice, since this leads to changed Gemfile.lock, whenever the bundler is executed on a different platform. Also bundle package --all-platforms doesn't work properly, when gems are declared conditionally.

@LouisaNikita
Copy link

LouisaNikita commented Aug 5, 2024 via email

@larskanis
Copy link
Contributor Author

In principle the gems could also be added to the listen.gemspec, like 'rb-fsevent' and
'rb-inotify'. But this would install them for all users of 'listen', although only a small subset needs them.

Both gems 'wdm' and 'rb-kqueue' can be installed on any platform.
They fail when require 'wdm' or 'rb-kqueue' is called.
So the conditions in the Gemfile can be removed and should not be recommended.

Having conditions in the Gemfile is generally bad practice, since this leads to changed Gemfile.lock, whenever the bundler is executed on a different platform.
Also "bundle package --all-platforms" doesn't work properly, when gems are declared conditionally.
@larskanis
Copy link
Contributor Author

Any chance to get this merged?

@rymai
Copy link
Member

rymai commented Mar 3, 2025

Thanks, looks good to me!

@rymai rymai merged commit 06fe819 into guard:master Mar 3, 2025
1 check passed
@larskanis larskanis deleted the gem-conditions branch March 3, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants