Module: PSWindows::File
Instance Attribute Summary
Attributes included from Beaker::CommandFactory
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
18 19 20 21 |
# File 'lib/beaker/host/pswindows/file.rb', line 18 def file_exist?(path) result = exec(Beaker::Command.new("if exist #{path} echo true"), :acceptable_exit_codes => [0, 1]) result.stdout =~ /true/ end |
#path_split(paths) ⇒ Object
14 15 16 |
# File 'lib/beaker/host/pswindows/file.rb', line 14 def path_split(paths) paths.split(';') end |
#tmpdir(name) ⇒ Object
9 10 11 12 |
# File 'lib/beaker/host/pswindows/file.rb', line 9 def tmpdir(name) result = exec(powershell('[System.IO.Path]::GetTempPath()')) result.stdout.chomp() end |
#tmpfile(name) ⇒ Object
4 5 6 7 |
# File 'lib/beaker/host/pswindows/file.rb', line 4 def tmpfile(name) result = exec(powershell('[System.IO.Path]::GetTempFileName()')) result.stdout.chomp() end |