tomlobato/sys_watchdog

View on GitHub
lib/sys_watchdog/core_extensions.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Exception
  def desc
    "#{ message } #{ backtrace&.join "\n" }"
  end
end

def log_ex e
  STDERR.puts e.desc
end

def match_root_or_current_user stat
  (stat.uid == 0           and stat.gid == 0) ||
  (stat.uid == Process.uid and stat.gid == Process.gid)
end