Class: RailsSpotlight::Middlewares::Handlers::CodeAnalysisActionHandler

Inherits:
BaseActionHandler
  • Object
show all
Defined in:
lib/rails_spotlight/middlewares/handlers/code_analysis_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:



12
13
14
15
# File 'lib/rails_spotlight/middlewares/handlers/code_analysis_action_handler.rb', line 12

def execute
  raise Forbidden.new('Code analysis is disabled', code: :disabled_rubocop_settings) unless enabled?
  raise UnprocessableEntity.new('Please add rubocop to your project', code: :rubocop_not_installed) unless rubocop_installed?
end

#skip_project_validation?Boolean

Returns:

  • (Boolean)


10
# File 'lib/rails_spotlight/middlewares/handlers/code_analysis_action_handler.rb', line 10

def skip_project_validation? = true