class TeutonFile

Public Class Methods

new(teuton_host, param) click to toggle source
# File lib/teuton/case_manager/case/builtin/teuton_file.rb, line 3
def initialize(teuton_host, param)
  @teuton_host = teuton_host
  @parent = teuton_host.parent
  @result = @parent.result
  @host = teuton_host.host
  @param = param
end

Public Instance Methods

directory?() click to toggle source
# File lib/teuton/case_manager/case/builtin/teuton_file.rb, line 17
def directory?
  @parent.target("File #{@param} is directory?")
  @parent.run "file #{@param}", on: @host
  @parent.expect @result.grep_v('cannot open').grep(@param).grep('directory').count.eq 1
end
exist?() click to toggle source
# File lib/teuton/case_manager/case/builtin/teuton_file.rb, line 11
def exist?
  @parent.target("File #{@param} exists?")
  @parent.run "file #{@param}", on: @host
  @parent.expect @result.grep_v('cannot open').grep(@param).count.eq 1
end
regular?() click to toggle source
# File lib/teuton/case_manager/case/builtin/teuton_file.rb, line 23
def regular?
  @parent.target("File #{@param} is regular?")
  @parent.run "file #{@param}", on: @host
  @parent.expect @result.grep(@param).grep('directory').count.eq 0
end