Module: Slackistrano::Messaging::Helpers
- Included in:
- Base
- Defined in:
- lib/slackistrano/messaging/helpers.rb
Instance Method Summary collapse
- #application ⇒ Object
- #branch ⇒ Object
- #deployer ⇒ Object
-
#elapsed_time ⇒ Object
Return the elapsed running time as a string.
- #icon_emoji ⇒ Object
- #icon_url ⇒ Object
- #stage(default = 'an unknown stage') ⇒ Object
- #username ⇒ Object
Instance Method Details
#application ⇒ Object
25 26 27 |
# File 'lib/slackistrano/messaging/helpers.rb', line 25 def application fetch(:application) end |
#branch ⇒ Object
21 22 23 |
# File 'lib/slackistrano/messaging/helpers.rb', line 21 def branch fetch(:branch) end |
#deployer ⇒ Object
17 18 19 |
# File 'lib/slackistrano/messaging/helpers.rb', line 17 def deployer ENV['USER'] || ENV['USERNAME'] end |
#elapsed_time ⇒ Object
Return the elapsed running time as a string.
Examples: 21-18:26:30, 15:28:37, 01:14
38 39 40 |
# File 'lib/slackistrano/messaging/helpers.rb', line 38 def elapsed_time `ps -p #{$$} -o etime=`.strip end |
#icon_emoji ⇒ Object
9 10 11 |
# File 'lib/slackistrano/messaging/helpers.rb', line 9 def icon_emoji nil end |
#icon_url ⇒ Object
5 6 7 |
# File 'lib/slackistrano/messaging/helpers.rb', line 5 def icon_url 'https://raw.githubusercontent.com/phallstrom/slackistrano/master/images/slackistrano.png' end |
#stage(default = 'an unknown stage') ⇒ Object
29 30 31 |
# File 'lib/slackistrano/messaging/helpers.rb', line 29 def stage(default = 'an unknown stage') fetch(:stage, default) end |
#username ⇒ Object
13 14 15 |
# File 'lib/slackistrano/messaging/helpers.rb', line 13 def username 'Slackistrano' end |