Class: Mrsk::Commands::Auditor
- Defined in:
- lib/mrsk/commands/auditor.rb
Instance Attribute Summary collapse
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Attributes inherited from Base
Instance Method Summary collapse
-
#broadcast(line) ⇒ Object
Runs locally.
-
#initialize(config, role: nil) ⇒ Auditor
constructor
A new instance of Auditor.
-
#record(line) ⇒ Object
Runs remotely.
- #reveal ⇒ Object
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
#role ⇒ Object (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 |
#reveal ⇒ Object
25 26 27 |
# File 'lib/mrsk/commands/auditor.rb', line 25 def reveal [ :tail, "-n", 50, audit_log_file ] end |