Class: RakeNotifier::Ikachan
Defined Under Namespace
Classes: Client
Constant Summary collapse
- START_LABEL =
"\x02\x0307[START]\x0f"- SUCCESS_LABEL =
"\x02\x0303[SUCCESS]\x0f"- FAILED_LABEL =
"\x02\x0304[FAILED]\x0f"
Instance Method Summary collapse
- #completed_task(task, system_exit) ⇒ Object
-
#initialize(url, channel) ⇒ Ikachan
constructor
A new instance of Ikachan.
- #started_task(task) ⇒ Object
Constructor Details
#initialize(url, channel) ⇒ Ikachan
Returns a new instance of Ikachan.
13 14 15 |
# File 'lib/rake_notifier/ikachan.rb', line 13 def initialize(url, channel) @client = Client.new(url, channel) end |
Instance Method Details
#completed_task(task, system_exit) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/rake_notifier/ikachan.rb', line 24 def completed_task(task, system_exit) label = system_exit.success? ? SUCCESS_LABEL : FAILED_LABEL notice " \#{label} $ \#{task.reconstructed_command_line}\n (exit \#{system_exit.status} from \#{hostname} at \#{Time.now} RAILS_ENV=\#{rails_env})\n EOS\nend\n".strip_heredoc |
#started_task(task) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rake_notifier/ikachan.rb', line 17 def started_task(task) notice " \#{START_LABEL} $ \#{task.reconstructed_command_line}\n (from \#{hostname} at \#{Time.now} RAILS_ENV=\#{rails_env})\n EOS\nend\n".strip_heredoc |