Module: Console1984::Supervisor::Executor

Extended by:
ActiveSupport::Concern
Included in:
Console1984::Supervisor
Defined in:
lib/console1984/supervisor/executor.rb

Instance Method Summary collapse

Instance Method Details

#execute(&block) ⇒ Object



15
16
17
18
19
# File 'lib/console1984/supervisor/executor.rb', line 15

def execute(&block)
  run_user_command do
    with_encryption_mode(&block)
  end
end

#execute_supervised(commands, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/console1984/supervisor/executor.rb', line 4

def execute_supervised(commands, &block)
  run_system_command { session_logger.before_executing commands }
  execute(&block)
rescue Console1984::Errors::ForbiddenCommand, Console1984::Errors::ForbiddenClassManipulation
  puts "Forbidden command attempted: #{commands.join("\n")}"
  run_system_command { session_logger.suspicious_commands_attempted commands }
  nil
ensure
  run_system_command { session_logger.after_executing commands }
end

#executing_user_command?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/console1984/supervisor/executor.rb', line 21

def executing_user_command?
  @executing_user_command
end