Class: Mrsk::Commands::Auditor

Inherits:
Base
  • Object
show all
Defined in:
lib/mrsk/commands/auditor.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#container_id_for, #run_over_ssh

Constructor Details

#initialize(config, role: nil) ⇒ Auditor

Returns a new instance of Auditor.



6
7
8
9
# File 'lib/mrsk/commands/auditor.rb', line 6

def initialize(config, role: nil)
  super(config)
  @role = role
end

Instance Attribute Details

#roleObject (readonly)

Returns the value of attribute role.



4
5
6
# File 'lib/mrsk/commands/auditor.rb', line 4

def role
  @role
end

Instance Method Details

#broadcast(line) ⇒ Object

Runs locally



19
20
21
22
23
# File 'lib/mrsk/commands/auditor.rb', line 19

def broadcast(line)
  if broadcast_cmd = config.audit_broadcast_cmd
    [ broadcast_cmd, tagged_broadcast_line(line) ]
  end
end

#record(line) ⇒ Object

Runs remotely



12
13
14
15
16
# File 'lib/mrsk/commands/auditor.rb', line 12

def record(line)
  append \
    [ :echo, tagged_record_line(line) ],
    audit_log_file
end

#revealObject



25
26
27
# File 'lib/mrsk/commands/auditor.rb', line 25

def reveal
  [ :tail, "-n", 50, audit_log_file ]
end