Class: Gemometer::Notifiers::Slack

Inherits:
Base
  • Object
show all
Defined in:
lib/gemometer/notifiers/slack.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#gems, #key, #url, #username

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#notify

Constructor Details

#initialize(opts) ⇒ Slack

Returns a new instance of Slack.



7
8
9
10
# File 'lib/gemometer/notifiers/slack.rb', line 7

def initialize(opts)
  @channel = opts.delete(:channel)
  super(opts)
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/gemometer/notifiers/slack.rb', line 5

def channel
  @channel
end

Class Method Details

.mandatory_optionsObject



12
13
14
# File 'lib/gemometer/notifiers/slack.rb', line 12

def self.mandatory_options
  [:url]
end

Instance Method Details

#messageObject



16
17
18
19
20
# File 'lib/gemometer/notifiers/slack.rb', line 16

def message
  msg = "Outdated gems:\n"
  gems.each { |g| msg += "\n    #{ruby_gems_link(g.name)} #{g.message_line}" }
  msg += "\n-"
end