Class: Projects::ImportErrorFilter

Inherits:
Object
  • Object
show all
Defined in:
app/services/projects/import_error_filter.rb

Overview

Used by project imports, it removes any potential paths included in an error message that could be stored in the DB

Constant Summary collapse

ERROR_MESSAGE_FILTER =
/[^\s]*#{File::SEPARATOR}[^\s]*(?=(\s|\z))/.freeze
FILTER_MESSAGE =
'[FILTERED]'

Class Method Summary collapse

Class Method Details

.filter_message(message) ⇒ Object


10
11
12
# File 'app/services/projects/import_error_filter.rb', line 10

def self.filter_message(message)
  message.gsub(ERROR_MESSAGE_FILTER, FILTER_MESSAGE)
end