Class: RailsSpotlight::Middlewares::Handlers::ConsoleActionHandler

Inherits:
BaseActionHandler
  • Object
show all
Defined in:
lib/rails_spotlight/middlewares/handlers/console_action_handler.rb

Constant Summary

Constants inherited from BaseActionHandler

BaseActionHandler::BaseError, BaseActionHandler::Forbidden, BaseActionHandler::NotFound, BaseActionHandler::UnprocessableEntity, BaseActionHandler::UnsupportedMediaType

Instance Attribute Summary

Attributes inherited from BaseActionHandler

#content_type, #request, #request_id

Instance Method Summary collapse

Methods inherited from BaseActionHandler

#call, #initialize

Constructor Details

This class inherits a constructor from RailsSpotlight::Middlewares::Handlers::BaseActionHandler

Instance Method Details

#executeObject

Raises:



8
9
10
11
12
13
# File 'lib/rails_spotlight/middlewares/handlers/console_action_handler.rb', line 8

def execute
  raise Forbidden.new('Console is disabled', code: :disabled_irb_console_settings) unless enabled?

  RailsSpotlight.config.logger && RailsSpotlight.config.logger.info("Executing command: #{command}") # rubocop:disable Style/SafeNavigation
  executor.execute(command)
end