Class: OsCtld::Assets::Symlink

Inherits:
Assets::BaseFile
  • Object
show all
Defined in:
lib/osctld/assets/symlink.rb

Instance Method Summary collapse

Instance Method Details

#statObject (protected)



19
20
21
# File 'lib/osctld/assets/symlink.rb', line 19

def stat
  @stat ||= File.lstat(path)
end

#validate(run) ⇒ Object (protected)



9
10
11
12
13
14
15
16
17
# File 'lib/osctld/assets/symlink.rb', line 9

def validate(run)
  begin
    add_error('not a symlink') if exist? && !stat.symlink?
  rescue Errno::ENOENT
    add_error('does not exist')
  end

  super
end