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

Suggest quicker bundle add for installation in README.md generated by bundle gem #5337

Merged
merged 2 commits into from Mar 6, 2022

Conversation

bradgessler
Copy link
Contributor

@bradgessler bradgessler commented Feb 9, 2022

Reduce the number of steps required to install a gem from two steps to one by using bundle add

What was the end-user or developer problem that led to this PR?

I keep seeing 2-step installation instructions for installing gems on README's all around the internet. bundler add has been around long enough now where it seems safe to suggest to people installing a gem to use that command.

This will save thousands of people-hours per year and have the advantage of locking the dependency with a ~> by default, which will save even more time.

What is your fix for the problem, implemented in this PR?

Updated the README.md.tt doc to tell people how to install a gem via bundle add instead of the old two-step method.

Make sure the following tasks are checked

@welcome
Copy link

welcome bot commented Feb 9, 2022

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

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed some minor thing.

bundler/lib/bundler/templates/newgem/README.md.tt Outdated Show resolved Hide resolved
@deivid-rodriguez deivid-rodriguez changed the title Update README.md.tt Suggest quicker bundle add for installation in README.md generated by bundle gem Feb 10, 2022
Reduce the number of steps required to install a gem from two steps to one by using `bundle add`
@simi simi enabled auto-merge March 6, 2022 20:31
@simi simi merged commit e474b28 into rubygems:master Mar 6, 2022
deivid-rodriguez pushed a commit that referenced this pull request Mar 9, 2022
Suggest quicker `bundle add` for installation in `README.md` generated by `bundle gem`

(cherry picked from commit e474b28)
@paddor
Copy link

paddor commented Mar 18, 2022

Funny how I just used it this week for the first time and now I see this in RubyWeekly. How long has it been around? 😅

@deivid-rodriguez
Copy link
Member

bundle add? Not sure, quite a while!

glaucocustodio added a commit to glaucocustodio/remote_bootstrap_modal that referenced this pull request Mar 21, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
brandonhilkert pushed a commit to brandonhilkert/sucker_punch that referenced this pull request Mar 22, 2022
* Use bundle add instead

As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.

* Update README.md
@jon-sully
Copy link

I'll be curious to see how much adoption this ends up getting — while I've used bundle add before, I tend to agree with Justin's take in standardrb/standard#402 (comment) both because I tend to see folks wanting to keep their Gemfile in alphabetical order but also because a lot of folks add a comment after each gem declaration with a high level description (which I think is good practice)

@indirect
Copy link
Member

I strongly prefer bundle add followed by whatever edits you want—it's much faster to bundle add and then edit your Gemfile than it is to look up the current version of a gem and type a version constraint by hand.

@bradgessler
Copy link
Contributor Author

bradgessler commented Mar 24, 2022

I'll be curious to see how much adoption this ends up getting — while I've used bundle add before, I tend to agree with Justin's take in standardrb/standard#402 (comment) both because I tend to see folks wanting to keep their Gemfile in alphabetical order but also because a lot of folks add a comment after each gem declaration with a high level description (which I think is good practice)

I encourage you to read https://bundler.io/man/bundle-add.1.html, note the gaps in your concerns, and enhance bundle add to insert alphabetically or have a comment CLI flag that automatically inserts the comment above the Gemfile entry when added. Those are all good ideas.

It doesn't bother me that much that maintainers, like Justin, don't want to use bundle add yet. I'd guess they feel the change is pedantic and it's not an established norm yet (they're not wrong).

Between this PR and making people more aware of bundle add in newsletters like Ruby Weekly or some of the newer Rails docs, I'm confident we'll get to our "add a gem with one command" nirvana in the near future.

@deivid-rodriguez
Copy link
Member

I think when you first add a gem to your application you don't necessarily care about the Gemfile style. You might just want to try it out, see if it works for your application, or whatever. bundle add gets the job done quickly for everyone. Those who want to keep a curated Gemfile (which I really like and recommend) still need to do similar edits than before, so I don't think this really changes the experience for them.

@jon-sully
Copy link

Great (and pragmatic) thoughts, @bradgessler. 👍

@simi
Copy link
Member

simi commented Mar 24, 2022

ℹ️ I left some comments regarding problem with commands modifying Gemfile at rubygems/rfcs#14 (comment).

dhh pushed a commit to rails/kredis that referenced this pull request Mar 30, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
dhh pushed a commit to rails/jsbundling-rails that referenced this pull request Mar 30, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
dhh pushed a commit to rails/cssbundling-rails that referenced this pull request Mar 30, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
dhh pushed a commit to rails/importmap-rails that referenced this pull request Mar 30, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
joshuacronemeyer pushed a commit to travisjeffery/timecop that referenced this pull request Jun 18, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
composerinteralia pushed a commit to thoughtbot/factory_bot that referenced this pull request Nov 16, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
patrickm68 added a commit to patrickm68/bundling-rails that referenced this pull request Dec 1, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
patrickm68 added a commit to patrickm68/js-bundling-rails that referenced this pull request Dec 1, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
connorchris831 pushed a commit to connorchris831/factory_bot that referenced this pull request Dec 13, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
connorchris831 pushed a commit to connorchris831/good_job that referenced this pull request Dec 19, 2022
* Use bundle add instead

As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.

* Update README.md

Co-authored-by: Ben Sheldon [he/him] <bensheldon@gmail.com>
titan2gman added a commit to titan2gman/jsbundling-rails that referenced this pull request Dec 27, 2022
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
OneDev0411 added a commit to OneDev0411/ruby-good-job that referenced this pull request Mar 17, 2023
* Use bundle add instead

As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.

* Update README.md

Co-authored-by: Ben Sheldon [he/him] <bensheldon@gmail.com>
tagliala pushed a commit to tagliala/pundit that referenced this pull request Mar 26, 2023
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
smartech7 pushed a commit to smartech7/ruby-css-bundling that referenced this pull request Aug 4, 2023
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
smartech7 pushed a commit to smartech7/ruby-import-maps that referenced this pull request Aug 4, 2023
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
smartech7 pushed a commit to smartech7/ruby-js-bundling that referenced this pull request Aug 4, 2023
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
starter69 pushed a commit to starter69/Kredis that referenced this pull request Aug 25, 2023
As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.
legendarydeveloper919 added a commit to legendarydeveloper919/good_job that referenced this pull request Mar 15, 2024
* Use bundle add instead

As per rubygems/rubygems#5337, we can simplify the steps of adding a gem.

* Update README.md

Co-authored-by: Ben Sheldon [he/him] <bensheldon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants