Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle remove error #6768

Closed
dduugg opened this issue Oct 29, 2018 · 0 comments
Closed

bundle remove error #6768

dduugg opened this issue Oct 29, 2018 · 0 comments

Comments

@dduugg
Copy link
Contributor

dduugg commented Oct 29, 2018

Given a simple Gemfile consisting of:

gem "rack"
group :test do
  gem "coffee-script-source"
end

When invoking bundle remove rack, the expected result is that the Gemfile looks like:

group :test do
  gem "coffee-script-source"
end

The actual result is an error:

$ bundle remove rack
Removing gems from /path/to/Gemfile

[!] There was an error parsing `Gemfile`: syntax error, unexpected end-of-input - group :test do
              ^. Bundler cannot continue.

 #  from /Users/duggiestyle/Projects/bundler/Gemfile:1
 #  -------------------------------------------
 >  group :test do
 #  -------------------------------------------
ghost pushed a commit that referenced this issue Oct 30, 2018
6769: Fix `remove` when block method appears in gem name r=segiddins a=dduugg

Thanks so much for the contribution!
To make reviewing this PR a bit easier, please fill out answers to the following questions.

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

#6768

### What was your diagnosis of the problem?

`remove_nested_blocks` considers any appearance of text matching a block method (`group source env install_if`) to be an occurrence of a nested block.

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

`remove_nested_blocks` should only reduce the scope of where a nested block method can occur.

### Why did you choose this fix out of the possible options?

Another approach would use word delimiters rather than `starts_with?` to find nested block methods, but this is probably fine.


Co-authored-by: Douglas Eichelberger <[email protected]>
colby-swandale pushed a commit that referenced this issue Mar 23, 2019
6769: Fix `remove` when block method appears in gem name r=segiddins a=dduugg

Thanks so much for the contribution!
To make reviewing this PR a bit easier, please fill out answers to the following questions.

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

#6768

### What was your diagnosis of the problem?

`remove_nested_blocks` considers any appearance of text matching a block method (`group source env install_if`) to be an occurrence of a nested block.

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

`remove_nested_blocks` should only reduce the scope of where a nested block method can occur.

### Why did you choose this fix out of the possible options?

Another approach would use word delimiters rather than `starts_with?` to find nested block methods, but this is probably fine.


Co-authored-by: Douglas Eichelberger <[email protected]>
(cherry picked from commit 70f2afe)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants