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

Summary

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

@rails-bot
Copy link

r? @pixeltrix

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

action :gem, "faker", version: [">= 0.1.0", "< 0.3.0"]

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

Choose a reason for hiding this comment

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

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@yhirano55 yhirano55 force-pushed the support_multiple_version_for_gem_method branch from 1bb0d03 to be49c30 Compare August 19, 2017 06:05
@matthewd matthewd merged commit aa1dc38 into rails:master Aug 31, 2017
@yhirano55 yhirano55 deleted the support_multiple_version_for_gem_method branch August 31, 2017 06:35
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

5 participants