End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Requirement.create
create(*inputs)
lib/rubygems/requirement.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rubygems/requirement.rb, line 54
def self.create(*inputs)
return new inputs if inputs.length > 1
input = inputs.shift
case input
when Gem::Requirement then
input
when Gem::Version, Array then
new input
when "!" then
source_set
else
if input.respond_to? :to_str
new [input.to_str]
else
default
end
end
end
Factory method to create a Gem::Requirement object. Input may be a Version, a String, or nil. Intended to simplify client code.
If the input is “weird”, the default version requirement is returned.