Class: CLIUtils::FilepathExistsValidator
- Inherits:
-
PrefValidator
- Object
- PrefValidator
- CLIUtils::FilepathExistsValidator
- Defined in:
- lib/cliutils/prefs/pref_validators/filepath_exists_validator.rb
Overview
A Validator to verify whether a Pref answer is a local filepath that exists.
Instance Attribute Summary
Attributes inherited from PrefValidator
Instance Method Summary collapse
-
#validate(text) ⇒ String
Runs the Validator against the answer.
Methods included from Messaging
Instance Method Details
#validate(text) ⇒ String
Runs the Validator against the answer.
10 11 12 13 |
# File 'lib/cliutils/prefs/pref_validators/filepath_exists_validator.rb', line 10 def validate(text) @is_valid = Pathname.new(text.to_s).exist? @message = "Path does not exist locally: #{ text }" end |