Module: Capistrano::Dingtalk::Messaging::Helpers
- Included in:
- Base
- Defined in:
- lib/capistrano/dingtalk/messaging/helpers.rb
Instance Method Summary collapse
- #application ⇒ Object
- #branch ⇒ Object
- #deployer ⇒ Object
-
#elapsed_time ⇒ Object
Return the elapsed running time as a string.
- #stage(default = 'an unknown stage') ⇒ Object
- #username ⇒ Object
Instance Method Details
#application ⇒ Object
15 16 17 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 15 def application fetch(:application) end |
#branch ⇒ Object
11 12 13 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 11 def branch fetch(:branch) end |
#deployer ⇒ Object
7 8 9 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 7 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
28 29 30 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 28 def elapsed_time `ps -p #{$PROCESS_ID} -o etime=`.strip end |
#stage(default = 'an unknown stage') ⇒ Object
19 20 21 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 19 def stage(default = 'an unknown stage') fetch(:stage, default) end |
#username ⇒ Object
3 4 5 |
# File 'lib/capistrano/dingtalk/messaging/helpers.rb', line 3 def username 'cap-dingtalk-bot' end |