
Refactor Notifier
Reported by Simon Rozet | February 27th, 2009 @ 01:15 PM
I ran metric_fu (I'll set it up on r2d2 later BTW) on Integrity last night and it reported some duplication on Notifier, so I went down and looked at it.
So, IMO, we should try to remove the magic found in Notifier.available. I suggest that we notifiers to be "registered", either by the notifier itself or by the user.
By the user
In config.ru
:
require "integrity"
require "integrity/notifier/email"
require "integrity/notifier/irc"
Integrity.notify_with :email, :irc
run Integrity::App
On the side of the notifier
class Integrity::Notifier::Email
def self.to_haml
end
# etc
end
Integrity.can_has :email, Integrity::Notifier::Email
The first requires to config stuff outside of the web interface. bad. But, the alternative is more... intrusive. One think to keep in mind when thinking about this is #41 (notification hook)
WDYT?
Comments and changes to this ticket
-
Simon Rozet February 27th, 2009 @ 01:16 PM
- Assigned user cleared.
- State changed from new to discuss
-
ronin-278 (at lighthouseapp) February 27th, 2009 @ 01:19 PM
I like the first option better. Buuuut, considering that you already have to go and require "notifier/email" or whatever, maybe it makes sense that whenever a notifier is loaded it registers itself.
-
Simon Rozet March 18th, 2009 @ 09:28 PM
- State changed from discuss to open
- Assigned user set to Simon Rozet
-
ronin-278 (at lighthouseapp) March 30th, 2009 @ 04:17 PM
(from [15ba26a4425ef1d08ffe9ff051aea2161836b346]) Require notifiers to be registered
Less magic. See [#104] http://github.com/foca/integrity...
-
Simon Rozet March 31st, 2009 @ 11:07 PM
- Tag set to notifier
- State changed from open to resolved
-
Simon Rozet March 31st, 2009 @ 11:08 PM
- State changed from resolved to review
-
Simon Rozet April 5th, 2009 @ 05:19 PM
- State changed from review to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Automated continuous integration server that doesn't suck.
People watching this ticket
Tags
Referenced by
-
95 Update notifiers matchers/helpers Duplicate with "Notifier Refactor" #104
-
104 Refactor Notifier Less magic. See [#104] http://github.com/foca/integrity...