Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Serge::Engine::Roles::ErrorMailer #51

Open
prat0088 opened this issue Dec 27, 2016 · 1 comment
Open

Create Serge::Engine::Roles::ErrorMailer #51

prat0088 opened this issue Dec 27, 2016 · 1 comment

Comments

@prat0088
Copy link
Contributor

prat0088 commented Dec 27, 2016

Created an issue to track the discussion of a change I plan to work on.

I'm writing a new parser plugin. I see 50-100 lines of email notification code duplicated across most plugins. I'd like to factor that out into a reusable utility.

I plan to use Role::Tiny. It has been around for years, has few dependencies, and was recently updated. I initially investigated a solution that didn't require additional modules, but there was no clean and easy way to execute code after init and other parent methods. I also didn't want to introduce another base class, PluginErrorReporter.

I will also create a more generic Mailer role to be used by ErrorMailer and Completeness.

I'll plan on creating a PR for the above enhancements plus Serge::Engine::Plugin::parse_csv.

Feedback is appreciated.

@iafan
Copy link
Contributor

iafan commented Dec 28, 2016

Yes, emailing code needs to be separated — thanks for looking into this. I don't think we need to start with Role::Tiny, since this task can be done by the means of interfaces — something Serge is already using — see https://github.com/evernote/serge/tree/master/lib/Serge/Interface. This is basically a way to add common functionality to different plugins without adding new concepts or dependencies. So you can create a new interface that will implement emailing functionality and make plugins reuse it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants