Module: Unix::File
Instance Method Summary collapse
- #file_exist?(path) ⇒ Boolean
- #path_split(paths) ⇒ Object
- #tmpdir(name) ⇒ Object
- #tmpfile(name) ⇒ Object
Methods included from Beaker::CommandFactory
Instance Method Details
#file_exist?(path) ⇒ Boolean
16 17 18 19 |
# File 'lib/beaker/host/unix/file.rb', line 16 def file_exist?(path) result = exec(Beaker::Command.new("test -e #{path}"), :acceptable_exit_codes => [0, 1]) result.exit_code == 0 end |
#path_split(paths) ⇒ Object
12 13 14 |
# File 'lib/beaker/host/unix/file.rb', line 12 def path_split(paths) paths.split(':') end |
#tmpdir(name) ⇒ Object
8 9 10 |
# File 'lib/beaker/host/unix/file.rb', line 8 def tmpdir(name) execute("mktemp -dt #{name}.XXXXXX") end |
#tmpfile(name) ⇒ Object
4 5 6 |
# File 'lib/beaker/host/unix/file.rb', line 4 def tmpfile(name) execute("mktemp -t #{name}.XXXXXX") end |