Class: Kamal::Commands::Auditor

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

Constant Summary

Constants inherited from Base

Base::DOCKER_HEALTH_STATUS_FORMAT

Instance Attribute Summary collapse

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#container_id_for, #ensure_docker_installed, #make_directory, #make_directory_for, #remove_directory, #remove_file, #run_over_ssh

Constructor Details

#initialize(config, **details) ⇒ Auditor

Returns a new instance of Auditor.



5
6
7
8
# File 'lib/kamal/commands/auditor.rb', line 5

def initialize(config, **details)
  super(config)
  @details = details
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



2
3
4
# File 'lib/kamal/commands/auditor.rb', line 2

def details
  @details
end

Instance Method Details

#record(line, **details) ⇒ Object

Runs remotely



11
12
13
14
15
# File 'lib/kamal/commands/auditor.rb', line 11

def record(line, **details)
  combine \
    make_run_directory,
    append([ :echo, escape_shell_value(audit_line(line, **details)) ], audit_log_file)
end

#revealObject



17
18
19
# File 'lib/kamal/commands/auditor.rb', line 17

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