Class: OsCtld::Assets::File
- Defined in:
- lib/osctld/assets/file.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #validate(run) ⇒ Object protected
Methods inherited from BaseFile
#exist?, #initialize, #mode, #stat
Methods inherited from Base
#add_error, #initialize, #prefetch_zfs, register, #run_validation, #state, #type, #valid?, #validate?, #validate_block
Constructor Details
This class inherits a constructor from OsCtld::Assets::BaseFile
Instance Method Details
#validate(run) ⇒ Object (protected)
9 10 11 12 13 14 15 16 17 |
# File 'lib/osctld/assets/file.rb', line 9 def validate(run) begin add_error('not a file') if exist? && !opts[:optional] && !stat.file? rescue Errno::ENOENT add_error('does not exist') end super end |