Method: Inspec::Resources::Crontab#read_crontab

Defined in:
lib/inspec/resources/crontab.rb

#read_crontabObject



51
52
53
54
55
56
57
58
59
# File 'lib/inspec/resources/crontab.rb', line 51

def read_crontab
  if is_system_crontab?
    raise Inspec::Exceptions::ResourceFailed, "Supplied crontab path '#{@path}' must exist!" if !inspec.file(@path).exist?
    ct = inspec.file(@path).content
  else
    ct = inspec.command(crontab_cmd).stdout
  end
  ct.lines.map { |l| parse_crontab_line(l) }.compact
end