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

Fix using add_resource with a block after gem in custom generators #22684

Conversation

teknofire
Copy link

This fixes using add_source with a block after calling gem in a custom generator. Otherwise it tries to create a Gemfile with the output from both methods on the same line and would then throw an error when bundle install gets run

for example if a custom generator had the following

gem "font-awesome-rails"

add_source "https://rails-assets.org" do
  gem 'rails-assets-bootstrap'
  gem 'rails-assets-jasny-bootstrap'
end

it would generate

gem 'font-awesome-rails'source 'https://rails-assets.org' do
  gem 'rails-assets-bootstrap'
  gem 'rails-assets-jasny-bootstrap'
end

and now generates

gem 'font-awesome-rails'
source 'https://rails-assets.org' do
  gem 'rails-assets-bootstrap'
  gem 'rails-assets-jasny-bootstrap'
end

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -1,5 +1,9 @@
## Rails 5.0.0.beta1 (December 18, 2015) ##

* Fix using `add_source` with a block after using `gem` in a custom generator.

*Will Fisher*
Copy link
Member

Choose a reason for hiding this comment

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

Can you move that above the ## Rails 5.0.0.beta1 (December 18, 2015) ## line?

@senny
Copy link
Member

senny commented Dec 21, 2015

@teknofire could you squash your commits?

@teknofire teknofire force-pushed the fix-using-add_resource-with-a-block-after-gem-call branch from 37d495f to 12dd2ca Compare December 21, 2015 15:07
@teknofire
Copy link
Author

@senny Ok, that should take care of it although the tests fail on the something in the rails master

senny added a commit that referenced this pull request Dec 21, 2015
…a-block-after-gem-call

Fix using add_resource with a block after gem in custom generators
@senny senny merged commit a88ab73 into rails:master Dec 21, 2015
@senny
Copy link
Member

senny commented Dec 21, 2015

@teknofire thank you 💛

@teknofire teknofire deleted the fix-using-add_resource-with-a-block-after-gem-call branch December 21, 2015 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants