Class: Jackal::Nellie::Formatter::SlackComment
- Inherits:
-
Formatter
- Object
- Formatter
- Jackal::Nellie::Formatter::SlackComment
- Includes:
- MessageExtract
- Defined in:
- lib/jackal-nellie/formatter/slack_comment.rb
Constant Summary collapse
- SOURCE =
Source service
:nellie
- DESTINATION =
Destination service
:slack
Instance Method Summary collapse
-
#format(payload) ⇒ Object
Format payload to provide output comment to GitHub.
Methods included from MessageExtract
#failure_message, #success_message
Instance Method Details
#format(payload) ⇒ Object
Format payload to provide output comment to GitHub
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jackal-nellie/formatter/slack_comment.rb', line 19 def format(payload) if(payload.get(:data, :nellie, :result)) msgs = payload.fetch(:data, :slack, :messages, []) if(payload.get(:data, :nellie, :result, :complete)) msgs << Smash.new( :description => "#{app_config.fetch(:branding, :name, 'Nellie')} job result:", :message => (payload), :color => :good ) else msgs << Smash.new( :description => "#{app_config.fetch(:branding, :name, 'Nellie')} job result:", :message => (payload), :color => :bad ) end payload.set(:data, :slack, :messages, msgs) end end |