* Initial automatic cleanup with rubocop * Fix syntax error introduced by rubocop * Cleanup seeds file * Cleanup lib folder * Exclude bin folder because it contains auto generated files * Make Rubocop a little bit more chatty * Block length should not include comments in the count * Cleanup config folder * Cleanup specs * Updated Rubocop version and generated a todo file * Fix broken ArticlesApi spec * Fix tests * Restored rubocop pre-commit hook
15 lines
436 B
Ruby
15 lines
436 B
Ruby
class ErrorMessageCleaner
|
|
attr_accessor :error_message
|
|
|
|
def initialize(error_message)
|
|
@error_message = error_message
|
|
end
|
|
|
|
def clean
|
|
if error_message.include? "expected key while parsing a block mapping at line"
|
|
"There was a problem parsing the front-matter YAML. Perhaps you need to escape a quote or a colon or something. Email yo@dev.to if you are having trouble."
|
|
else
|
|
error_message
|
|
end
|
|
end
|
|
end
|