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

Support multiple versions arguments for `gem` method of Generators #30323

Merged

Conversation

@yhirano55
Copy link
Contributor

@yhirano55 yhirano55 commented Aug 19, 2017

Summary

It seems that gem method is supported only single version.
So I've modified it, and added test cases.

@rails-bot
Copy link

@rails-bot rails-bot commented Aug 19, 2017

r? @pixeltrix

(@rails-bot has picked a reviewer for you, use r? to override)

railties/test/generators/actions_test.rb Outdated
action :gem, "faker", version: [">= 0.1.0", "< 0.3.0"]

assert_file "Gemfile" do |content|
assert_match /gem 'rspec', '>= 2\.0\.0\.a5'/, content

This comment has been minimized.

@y-yagi

y-yagi Aug 19, 2017
Member

This will cause Ruby warnings as shown below.

test/generators/actions_test.rb:81: warning: ambiguous first argument; put parentheses or a space even after `/' operator

You need to change like following.

assert_match(/gem 'rspec', '>= 2\.0\.0\.a5'/, content)

This comment has been minimized.

@yhirano55

yhirano55 Aug 19, 2017
Author Contributor

@y-yagi Thanks for your comment. I've changed it.

@yhirano55 yhirano55 force-pushed the yhirano55:support_multiple_version_for_gem_method branch to be49c30 Aug 19, 2017
@matthewd matthewd merged commit aa1dc38 into rails:master Aug 31, 2017
2 checks passed
2 checks passed
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@yhirano55 yhirano55 deleted the yhirano55:support_multiple_version_for_gem_method branch Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.