Class: Gesund::Checks::Link
- Inherits:
-
Object
- Object
- Gesund::Checks::Link
- Includes:
- Gesund::Check
- Defined in:
- lib/gesund/checks/link.rb
Instance Attribute Summary
Attributes included from Gesund::Check
Instance Method Summary collapse
-
#initialize(linkname, target = nil) ⇒ Link
constructor
A new instance of Link.
Methods included from Gesund::Check
Constructor Details
#initialize(linkname, target = nil) ⇒ Link
Returns a new instance of Link.
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/gesund/checks/link.rb', line 3 def initialize(linkname, target=nil) if not File.symlink?(linkname) self.success = false self. = "Symbolic link #{linkname} is not a symlink" elsif target self.success = (File.readlink(linkname) == target) self. = "Symbolic link somelink-xxx is#{self.success ? '' : ' not'} targetting #{target}" else self.success = true self. = "Symbolic link #{linkname} is a symlink" end end |