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

Support for gems.rb #658

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Support for gems.rb #658

merged 1 commit into from
Dec 14, 2022

Conversation

svoop
Copy link
Contributor

@svoop svoop commented Nov 25, 2022

This is a 🙋 feature or enhancement.

(Note: Rubocop errors prevent the tests to run, I've tested manually for now and wait for #644 to be merged. However, I create the PR now to get your comments on the changes already.)

Summary

Bundler added gems.rb/gems.locked as alternatives to Gemfile/Gemfile.lock some years ago, mainly to have proper syntax coloring in editors.

Bridgetown has a few places where Gemfile is hardcoded, this PR adds support for gems.rb. However, in order to assure downwards compatibility, the fallback Gemfile is maintained.

Thanks for reviewing and commenting!

@svoop svoop force-pushed the gemsrb branch 5 times, most recently from f350fb4 to 1e4ca6e Compare November 25, 2022 18:19
@jaredcwhite
Copy link
Member

I'll take a look at this shortly!

@jaredcwhite
Copy link
Member

jaredcwhite commented Nov 30, 2022

Thanks @svoop. This is starting to feel like we're re-implementing Bundler logic, so I poked around in the Bundler gem and it looks like indeed there are some helpful methods in the Bundler::SharedHelpers module. For example:

require "bundler/shared_helpers"

Bundler::SharedHelpers.in_bundle?

So maybe we could refactor this just to call out to relevant Bundler methods, so we don't need to maintain our own logic to determine/find gem file paths. See: https://github.com/rubygems/rubygems/blob/master/bundler/lib/bundler/shared_helpers.rb

@svoop
Copy link
Contributor Author

svoop commented Dec 1, 2022

@jaredcwhite This makes a lot of sense! Want me to have a go or do you rather want to refactor yourself?

@jaredcwhite
Copy link
Member

@svoop Feel free to jump right into it, but I'm happy to pair or offer any assistance!

@svoop
Copy link
Contributor Author

svoop commented Dec 13, 2022

@jaredcwhite Sorry for dropping the ball here, I've changed the implementation to use in_bundle?. (Kinda weird it returns nil or the path instead of true/false, Rubocop should throw a tantrum. 😄) It's all green, but I'm not sure whether it's fully covered by tests.

@jaredcwhite
Copy link
Member

@svoop I think we're fine for now. Seeing some more Rubocop failures but that seems to be unrelated to your changes so I'll go ahead and merge and then fix. Thanks!

@jaredcwhite jaredcwhite merged commit c428cd0 into bridgetownrb:main Dec 14, 2022
@svoop
Copy link
Contributor Author

svoop commented Dec 14, 2022

Cool, thanks @jaredcwhite

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.

2 participants