Class: Dependabot::Docker::Requirement

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

Overview

Lifted from the bundler package manager

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*requirements) ⇒ Requirement

Returns a new instance of Requirement.



31
32
33
34
35
36
37
# File 'lib/dependabot/docker/requirement.rb', line 31

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

  super(requirements)
end

Class Method Details

.requirements_array(requirement_string) ⇒ Object



19
20
21
# File 'lib/dependabot/docker/requirement.rb', line 19

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

Instance Method Details

#satisfied_by?(version) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/dependabot/docker/requirement.rb', line 24

def satisfied_by?(version)
  super(version.release_part)
end