Module: Checky::Validators::Version
- Defined in:
- lib/checky/validators/version.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.version_string ⇒ Object
11 12 13 14 15 16 |
# File 'lib/checky/validators/version.rb', line 11 def version_string command_path = storage.binary command_output = Checky.run("#{command_path} --version 2>&1").presence || Checky.run("#{command_path} -v 2>&1").presence command_output[/[0-9]+(?:\.[0-9]+)+/] end |
Instance Method Details
#check ⇒ Object
5 6 7 8 9 |
# File 'lib/checky/validators/version.rb', line 5 def check version = Gem::Version.new(version_string) requirement = Gem::Requirement.new(storage.version) requirement.satisfied_by?(version) end |
#message ⇒ Object
18 19 20 |
# File 'lib/checky/validators/version.rb', line 18 def "Checking #{storage.binary} version against #{storage.version}" end |