-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Gem::Requirement.create treat arguments as variable-length #1830
Gem::Requirement.create treat arguments as variable-length #1830
Conversation
I will fix the errors. |
Is this worth the performance penalty? |
Yes. |
We can write not only `Gem::Requirement.create([">= 1.2", "<= 1.3"])` but also `Gem::Requirement.create(">= 1.2", "<= 1.3")`
771c96b
to
6526dd0
Compare
Thanks your reviews. I feel the current style add_dependency 'example', '>= 1.0.0.a', '< 2.0.0' But it is only my subjectivity. Positive comments here will show the worth. |
lib/rubygems/requirement.rb
Outdated
@@ -51,7 +51,11 @@ class BadRequirementError < ArgumentError; end | |||
# If the input is "weird", the default version requirement is | |||
# returned. | |||
|
|||
def self.create input | |||
def self.create *inputs | |||
return create inputs if inputs.length > 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not new inputs
? This should match L63 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly it is useless method call. I fixed it.
@homu r+ |
📌 Commit 4455566 has been approved by |
… r=drbrain Gem::Requirement.create treat arguments as variable-length # Description: This PR enables `Gem::Requirement.create` to treat arguments as variable-length. Now, we can write only ```ruby Gem::Requirement.create([">= 1.2", "<= 1.3"]) ``` New style will be supported ```ruby Gem::Requirement.create(">= 1.2", "<= 1.3") ``` ______________ # Tasks: - [x] Describe the problem / feature - [x] Write tests - [x] Write code to solve the problem - [x] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
☀️ Test successful - status |
I appreciate your review and merge ! @segiddins @drbrain |
Description:
This PR enables
Gem::Requirement.create
to treat arguments as variable-length.Now, we can write only
New style will be supported
Tasks:
I will abide by the code of conduct.