Open
Description
Roadie should have some form of reporting system where it can scan an email for bad patterns and tell the user about it.
Suggestions for "warnings":
- Report on invalid URLs
- Warn about
<form>
, etc. in the email
Reporting should be transparent and optional. Ideas on implementation:
- Test modules. Include them, run the assertions on the email.
- This would be better served with another gem, right?
roadie-doctor
or something crazy like that..? - Doesn't help with detecting problems in production, where dynamic helpers might've ruined something that would appear okay in
test
.
- This would be better served with another gem, right?
- Callback for both enabling and for handling problems.
- Makes it very optional. Sadly, also a bit of a threshold to climb to enable it.
- See code sample 1 below.
- Store it on
Document
, when enabled.- Easier to enable and you can report it however you want afterwards. Might be more useful for more people since it's possible to send all of them in a single message.
- See code sample 2 below.
# Sample 1
unless RACK_ENV == "production"
document.report_problems = ->(error, doc) {
My.logger.warn error
}
end
# Sample 2
document.report_problems = true
html = document.transform
document.problems #=> [#<Roadie::Problem "Invalid URL: ...">]