class Gemometer::Notifiers::Slack
Attributes
channel[RW]
Public Class Methods
mandatory_options()
click to toggle source
# File lib/gemometer/notifiers/slack.rb, line 12 def self.mandatory_options [:url] end
new(opts)
click to toggle source
Calls superclass method
Gemometer::Notifiers::Base::new
# File lib/gemometer/notifiers/slack.rb, line 7 def initialize(opts) @channel = opts.delete(:channel) super(opts) end
Public Instance Methods
message()
click to toggle source
# 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
Private Instance Methods
data()
click to toggle source
# File lib/gemometer/notifiers/slack.rb, line 24 def data { text: message, channel: channel, username: 'Gemometer' # icon_url: "https://TODO:add-icon.png" }.reject{ |_, v| v.nil? } end
ruby_gems_link(name)
click to toggle source
# File lib/gemometer/notifiers/slack.rb, line 33 def ruby_gems_link(name) "<https://rubygems.org/gems/#{name}|#{name}>" end