module Capistrano::Dingtalk::Messaging::Helpers

Public Instance Methods

application() click to toggle source
# File lib/capistrano/dingtalk/messaging/helpers.rb, line 15
def application
  fetch(:application)
end
branch() click to toggle source
# File lib/capistrano/dingtalk/messaging/helpers.rb, line 11
def branch
  fetch(:branch)
end
deployer() click to toggle source
# File lib/capistrano/dingtalk/messaging/helpers.rb, line 7
def deployer
  ENV['USER'] || ENV['USERNAME']
end
elapsed_time() click to toggle source

Return the elapsed running time as a string.

Examples: 21-18:26:30, 15:28:37, 01:14

# 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') click to toggle source
# File lib/capistrano/dingtalk/messaging/helpers.rb, line 19
def stage(default = 'an unknown stage')
  fetch(:stage, default)
end
username() click to toggle source
# File lib/capistrano/dingtalk/messaging/helpers.rb, line 3
def username
  'cap-dingtalk-bot'
end