Class: Dependabot::Elm::Requirement
- Inherits:
-
Requirement
- Object
- Requirement
- Dependabot::Elm::Requirement
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/elm/requirement.rb
Constant Summary collapse
- ELM_PATTERN_RAW =
T.let( "(#{Elm::Version::VERSION_PATTERN}) (<=?) v (<=?) (#{Elm::Version::VERSION_PATTERN})".freeze, String )
- ELM_PATTERN =
/\A#{ELM_PATTERN_RAW}\z/
- ELM_EXACT_PATTERN =
/\A#{Elm::Version::VERSION_PATTERN}\z/
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*requirements) ⇒ Requirement
constructor
A new instance of Requirement.
- #satisfied_by?(version) ⇒ Boolean
Constructor Details
#initialize(*requirements) ⇒ Requirement
Returns a new instance of Requirement.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/dependabot/elm/requirement.rb', line 31 def initialize(*requirements) requirements = requirements.flatten.flat_map do |req_string| raise BadRequirementError, "Nil requirement not supported in Elm" if req_string.nil? req_string.split(",").map(&:strip).map do |r| convert_elm_constraint_to_ruby_constraint(r) end end super(requirements) end |
Class Method Details
.requirements_array(requirement_string) ⇒ Object
26 27 28 |
# File 'lib/dependabot/elm/requirement.rb', line 26 def self.requirements_array(requirement_string) [new(requirement_string)] end |