This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Fix singular groups on injecting gem#6627
Merged
bundlerbot merged 1 commit intorubygems:masterfrom Jul 30, 2018
Merged
Conversation
segiddins
approved these changes
Jul 17, 2018
lib/bundler/injector.rb
Outdated
|
|
||
| if d.groups != Array(:default) | ||
| group = d.groups.size == 1 ? ", :group => #{d.groups.inspect}" : ", :groups => #{d.groups.inspect}" | ||
| group = d.groups.size == 1 ? ", :group => :#{d.groups.first}" : ", :groups => #{d.groups.inspect}" |
Contributor
There was a problem hiding this comment.
nit: :group => #{d.groups.first.inspect}
43b7a54 to
38e761e
Compare
deivid-rodriguez
approved these changes
Jul 30, 2018
Contributor
|
@bundlerbot r+ |
Collaborator
|
📌 Commit 38e761e has been approved by |
Collaborator
bundlerbot
added a commit
that referenced
this pull request
Jul 30, 2018
Fix singular groups on injecting gem
### What was the end-user problem that led to this PR?
The problem was that on adding a gem to a group via
```bash
bundle add rack --group=dev
```
It gets added as
```ruby
gem "rack", :group => [:dev]
```
It should rather be
```ruby
gem "rack", :group => :dev
```
### What was your diagnosis of the problem?
My diagnosis was to not add single groups in the array.
### What is your fix for the problem, implemented in this PR?
My fix was to pick the element from the array of groups and append using
```ruby
":group => :#{d.groups.first}"
```
### Why did you choose this fix out of the possible options?
I chose this fix because it seemed to most appropriate.
Collaborator
|
☀️ Test successful - status-travis |
Contributor
|
Thanks @agrim123! ❤️ |
colby-swandale
pushed a commit
that referenced
this pull request
Oct 5, 2018
Fix singular groups on injecting gem
### What was the end-user problem that led to this PR?
The problem was that on adding a gem to a group via
```bash
bundle add rack --group=dev
```
It gets added as
```ruby
gem "rack", :group => [:dev]
```
It should rather be
```ruby
gem "rack", :group => :dev
```
### What was your diagnosis of the problem?
My diagnosis was to not add single groups in the array.
### What is your fix for the problem, implemented in this PR?
My fix was to pick the element from the array of groups and append using
```ruby
":group => :#{d.groups.first}"
```
### Why did you choose this fix out of the possible options?
I chose this fix because it seemed to most appropriate.
(cherry picked from commit 1a10427)
colby-swandale
pushed a commit
that referenced
this pull request
Oct 5, 2018
Fix singular groups on injecting gem
### What was the end-user problem that led to this PR?
The problem was that on adding a gem to a group via
```bash
bundle add rack --group=dev
```
It gets added as
```ruby
gem "rack", :group => [:dev]
```
It should rather be
```ruby
gem "rack", :group => :dev
```
### What was your diagnosis of the problem?
My diagnosis was to not add single groups in the array.
### What is your fix for the problem, implemented in this PR?
My fix was to pick the element from the array of groups and append using
```ruby
":group => :#{d.groups.first}"
```
### Why did you choose this fix out of the possible options?
I chose this fix because it seemed to most appropriate.
(cherry picked from commit 1a10427)
colby-swandale
pushed a commit
that referenced
this pull request
Oct 7, 2018
* 1-16-stable: Version 1.16.6 with changelog fix uninitialized @use_gvp instance var warning no longer test Ruby 1.9.3 against rubygems master Merge #6708 Auto merge of #6697 - walf443:added_changelog_section, r=hsbt Merge #6687 Merge #6686 Auto merge of #6670 - bundler:colby/invite-stephanie-morillo, r=segiddins Auto merge of #6627 - agrim123:agr-fix-add-groups, r=deivid-rodriguez Auto merge of #6612 - hdf1986:readme-bundle-add, r=segiddins Auto merge of #6495 - bundler:segiddins/6491-extra-gem-platform-in-lockfile, r=segiddins Auto merge of #6493 - agrim123:agr-update-bundle-update-docs, r=colby-swandale Auto merge of #6310 - utilum:rescue_unspecified_exception, r=segiddins Auto merge of #6184 - arbonap:pa-check-in-gemfile-docs, r=indirect fix typo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was the end-user problem that led to this PR?
The problem was that on adding a gem to a group via
It gets added as
It should rather be
What was your diagnosis of the problem?
My diagnosis was to not add single groups in the array.
What is your fix for the problem, implemented in this PR?
My fix was to pick the element from the array of groups and append using
":group => :#{d.groups.first}"Why did you choose this fix out of the possible options?
I chose this fix because it seemed to most appropriate.