Class: RailsSpotlight::Middlewares::Handlers::FileActionHandler
- Inherits:
-
BaseActionHandler
- Object
- BaseActionHandler
- RailsSpotlight::Middlewares::Handlers::FileActionHandler
- Defined in:
- lib/rails_spotlight/middlewares/handlers/file_action_handler.rb
Constant Summary
Constants inherited from BaseActionHandler
BaseActionHandler::Forbidden, BaseActionHandler::IncorrectResponseContentType, BaseActionHandler::NotFound, BaseActionHandler::UnprocessableEntity
Instance Attribute Summary
Attributes inherited from BaseActionHandler
#content_type, #request, #request_id
Instance Method Summary collapse
Methods inherited from BaseActionHandler
Constructor Details
This class inherits a constructor from RailsSpotlight::Middlewares::Handlers::BaseActionHandler
Instance Method Details
#execute ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rails_spotlight/middlewares/handlers/file_action_handler.rb', line 7 def execute raise NotFound, 'File not found' unless path_valid? if write_mode? try_to_update_file else File.read(file_path) end rescue => e # rubocop:disable Style/RescueStandardError raise UnprocessableEntity, e. end |