Class: Dependabot::Swift::Requirement

Inherits:
Requirement
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/swift/requirement.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*requirements) ⇒ Requirement

Patches Gem::Requirement to make it accept requirement strings like “~> 4.2.5, >= 4.2.5.1” without first needing to split them.



23
24
25
26
27
28
29
# File 'lib/dependabot/swift/requirement.rb', line 23

def initialize(*requirements)
  requirements = requirements.flatten.flat_map do |req_string|
    req_string.split(",").map(&:strip)
  end

  super(requirements)
end

Class Method Details

.requirements_array(requirement_string) ⇒ Object



17
18
19
# File 'lib/dependabot/swift/requirement.rb', line 17

def self.requirements_array(requirement_string)
  [new(requirement_string)]
end