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
Add --glob
flag to bundle add
#7557
Add --glob
flag to bundle add
#7557
Conversation
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
127be11
to
2769f43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this option gets a lot of use, but seems nice to have all options mapped to bundle add
flags 👍
I think people will need to run this with quotes, otherwise most shells will automatically expand *
if run from a directory with gemspecs matching the glob. But there's not much we can do about that. Maybe change tests examples to use quotes, explicitly document it? Not sure.
@deivid-rodriguez good points, thanks for the feedback!
I've changed the specs to use single quotes around the |
Nice, thanks! This looks good to me! There's a failed spec unrelated to your changes, don't worry about that. I'll merge this next week 👍 |
Bundler online documentation says that if the gem is located within a subdirectory of a git repository, you can use the `:glob` option to specify the location of its .gemspec `gem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'` This change allows for equivalent functionality from the bundler CLI `bundle add cf-copilot --git=https://github.com/cloudfoundry/copilot --glob=sdk/ruby/*.gemspec`
…add banner text for CLI recommending single quotes
269b6f1
to
6d2cf95
Compare
--glob
flag to bundle add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add `--glob` flag to `bundle add` (cherry picked from commit 153e98a)
Bundler online documentation says that if the gem is located within a subdirectory of a git repository, you can use the
:glob
option to specify the location of its .gemspec, docsgem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'
This change allows for equivalent functionality from the bundler CLI
bundle add cf-copilot --git=https://github.com/cloudfoundry/copilot --glob='sdk/ruby/*.gemspec'
What was the end-user or developer problem that led to this PR?
I'm working on some projects that require gems from remote git sources, and sometimes these projects don't specify the
.gemspec
file at the root of the repo. Instead of manually editing theGemfile
, I'd like to use bundler's CLI where possible.What is your fix for the problem, implemented in this PR?
My fix is to pass-through the
glob
option fromBundler::CLI#add(*gems)
, toBundler::Dependency#glob
to be used inBundler::Injector#build_gem_lines()
Make sure the following tasks are checked