Module: Capistrano::Messaging::Helpers

Included in:
Telegram
Defined in:
lib/capistrano/messaging/helpers.rb

Instance Method Summary collapse

Instance Method Details

#applicationObject



17
18
19
# File 'lib/capistrano/messaging/helpers.rb', line 17

def application
  fetch(:application)
end

#branchObject



13
14
15
# File 'lib/capistrano/messaging/helpers.rb', line 13

def branch
  fetch(:branch)
end

#deployerObject



9
10
11
# File 'lib/capistrano/messaging/helpers.rb', line 9

def deployer
  Etc.getpwnam(ENV['USER']).gecos
end

#elapsed_timeObject

Return the elapsed running time as a string.

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



30
31
32
# File 'lib/capistrano/messaging/helpers.rb', line 30

def elapsed_time
  `ps -p #{$$} -o etime=`.strip
end

#icon_emojiObject



5
6
7
# File 'lib/capistrano/messaging/helpers.rb', line 5

def icon_emoji
  options.fetch(:icon_emoji, nil)
end

#stage(default = 'an unknown stage') ⇒ Object



21
22
23
# File 'lib/capistrano/messaging/helpers.rb', line 21

def stage(default = 'an unknown stage')
  fetch(:stage, default)
end