Module: Cliver::Filter
- Defined in:
- lib/cliver/filter.rb
Overview
A Namespace to hold filter procs
Constant Summary
- IDENTITY =
The identity filter returns its input unchanged.
proc { |version| version }
Instance Method Summary (collapse)
-
- (String) apply(version)
Apply to some input.
-
- (Array<String>) requirements(requirements)
Apply to a list of requirements.
Instance Method Details
- (String) apply(version)
Apply to some input
24 25 26 |
# File 'lib/cliver/filter.rb', line 24 def apply(version) to_proc.call(version) end |
- (Array<String>) requirements(requirements)
Apply to a list of requirements
12 13 14 15 16 17 18 19 |
# File 'lib/cliver/filter.rb', line 12 def requirements(requirements) requirements.map do |requirement| req_parts = requirement.split(/\b(?=\d)/, 2) version = req_parts.last version.replace apply(version) req_parts.join end end |