Class: Cinch::Plugins::GithubNotifications::Poster
- Inherits:
-
Object
- Object
- Cinch::Plugins::GithubNotifications::Poster
- Includes:
- Cinch::Plugin
- Defined in:
- lib/cinch/plugins/github_notifications/poster.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Poster
constructor
A new instance of Poster.
- #listen(m, info) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Poster
Returns a new instance of Poster.
9 10 11 12 13 14 |
# File 'lib/cinch/plugins/github_notifications/poster.rb', line 9 def initialize(*args) super checker = Checker.new(config) checker.start end |
Instance Method Details
#listen(m, info) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cinch/plugins/github_notifications/poster.rb', line 18 def listen(m, info) event = info['type'].gsub(/([A-Z])/,"_\\1")[1..-7].downcase.to_sym unless Messages.respond_to?(event) debug "A github \"#{info['type']}\" was received, but Cinch::Plugins::Github::Messages.#{event} is not defined." return nil end = nil config[:announce].each_pair do |match, channels| if info['repo']['name'] =~ match channels.each do |channel| ||= Messages.send(event,info) Channel(channel).send() unless .nil? end end end end |