Skip to content
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
agrim123:agr-fix-add-groups
Jul 30, 2018
Merged

Fix singular groups on injecting gem#6627
bundlerbot merged 1 commit intorubygems:masterfrom
agrim123:agr-fix-add-groups

Conversation

@agrim123
Copy link
Copy Markdown
Contributor

@agrim123 agrim123 commented Jul 15, 2018

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

The problem was that on adding a gem to a group via

bundle add rack --group=dev

It gets added as

gem "rack", :group => [:dev]

It should rather be

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

":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.


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}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: :group => #{d.groups.first.inspect}

@agrim123 agrim123 force-pushed the agr-fix-add-groups branch from 43b7a54 to 38e761e Compare July 17, 2018 11:17
@deivid-rodriguez
Copy link
Copy Markdown
Contributor

@bundlerbot r+

@bundlerbot
Copy link
Copy Markdown
Collaborator

📌 Commit 38e761e has been approved by deivid-rodriguez

@bundlerbot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit 38e761e with merge 1a10427...

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.
@bundlerbot
Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-travis
Approved by: deivid-rodriguez
Pushing 1a10427 to master...

@bundlerbot bundlerbot merged commit 38e761e into rubygems:master Jul 30, 2018
@deivid-rodriguez
Copy link
Copy Markdown
Contributor

Thanks @agrim123! ❤️

@agrim123 agrim123 deleted the agr-fix-add-groups branch July 31, 2018 04:59
@colby-swandale colby-swandale modified the milestones: 1.17.0, 1.17.1 Sep 24, 2018
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants