Class: Toft::FileChecker
- Inherits:
-
Object
- Object
- Toft::FileChecker
- Includes:
- CommandExecutor
- Defined in:
- lib/toft/file_checker.rb
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #exist? ⇒ Boolean
- #filetype ⇒ Object
- #group ⇒ Object
-
#initialize(rootfs, path) ⇒ FileChecker
constructor
A new instance of FileChecker.
- #mode ⇒ Object
- #owner ⇒ Object
Methods included from CommandExecutor
Constructor Details
#initialize(rootfs, path) ⇒ FileChecker
Returns a new instance of FileChecker.
8 9 10 11 |
# File 'lib/toft/file_checker.rb', line 8 def initialize(rootfs, path) @rootfs = rootfs @path = path end |
Instance Method Details
#directory? ⇒ Boolean
17 18 19 |
# File 'lib/toft/file_checker.rb', line 17 def directory? filetype == "directory" end |
#exist? ⇒ Boolean
13 14 15 |
# File 'lib/toft/file_checker.rb', line 13 def exist? test("-e") end |
#filetype ⇒ Object
21 22 23 |
# File 'lib/toft/file_checker.rb', line 21 def filetype stat("%F") end |
#group ⇒ Object
29 30 31 |
# File 'lib/toft/file_checker.rb', line 29 def group stat("%G") end |
#mode ⇒ Object
33 34 35 |
# File 'lib/toft/file_checker.rb', line 33 def mode stat("%a") end |
#owner ⇒ Object
25 26 27 |
# File 'lib/toft/file_checker.rb', line 25 def owner stat("%U") end |