Module: RobotLab::Audit

Defined in:
lib/robot_lab/audit.rb,
lib/robot_lab/audit/hook.rb,
lib/robot_lab/audit/version.rb,
lib/robot_lab/audit/event_log.rb,
sig/robot_lab/audit.rbs

Defined Under Namespace

Classes: Error, EventLog, Hook

Constant Summary collapse

VERSION =

Returns:

  • (String)
'0.2.6'

Class Method Summary collapse

Class Method Details

.enable(db_path:) ⇒ Object

Configure the audit hook with a SQLite database path and register it globally.

Examples:

RobotLab::Audit.enable(db_path: "~/.robot_lab/audit.db")

Parameters:

  • db_path (String)

    path to the SQLite database file (created if absent)



16
17
18
19
20
21
22
23
# File 'lib/robot_lab/audit.rb', line 16

def self.enable(db_path:)
  unless defined?(RobotLab::Audit::Hook)
    raise Error, 'robot_lab must be loaded before calling RobotLab::Audit.enable'
  end

  Hook.event_log = EventLog.new(db_path: db_path)
  RobotLab.on(Hook)
end