Class: RakeNotifier::Slack
Defined Under Namespace
Classes: Client
Constant Summary collapse
- START_LABEL =
":construction: *[START]*"- SUCCESS_LABEL =
":congratulations: *[SUCCESS]*"- FAILED_LABEL =
":x: *[FAILED]*"
Instance Method Summary collapse
- #completed_task(task, system_exit) ⇒ Object
-
#initialize(token, channel, icon: nil, username: nil) ⇒ Slack
constructor
A new instance of Slack.
- #started_task(task) ⇒ Object
Constructor Details
Instance Method Details
#completed_task(task, system_exit) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/rake_notifier/slack.rb', line 22 def completed_task(task, system_exit) label = system_exit.success? ? SUCCESS_LABEL : FAILED_LABEL notice <<-EOS.strip_heredoc #{label} `$ #{task.reconstructed_command_line}` >>> exit #{system_exit.status} from #{hostname} at #{Time.now} RAILS_ENV=#{rails_env} EOS end |
#started_task(task) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rake_notifier/slack.rb', line 15 def started_task(task) notice <<-EOS.strip_heredoc #{START_LABEL} `$ #{task.reconstructed_command_line}` >>> from #{hostname} at #{Time.now} RAILS_ENV=#{rails_env} EOS end |