Class: Chatworkify::CwLib

Inherits:
Object
  • Object
show all
Defined in:
lib/chatworkify/cw.rb

Overview

Chatwork service libs

Class Method Summary collapse

Class Method Details

.message_body(status = :starting) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/chatworkify/cw.rb', line 34

def message_body(status = :starting)
  %(
[code]👻  #{text(status)}
● 𝕊𝕥𝕒𝕘𝕖  : #{fetch(:stage).upcase!}
● 𝕊𝕖𝕣𝕧𝕖𝕣  : #{fetch(:ip_address)}
● 𝔹𝕣𝕒𝕟𝕔𝕙 : #{fetch(:branch)}
● ℝ𝕖𝕧𝕚𝕤𝕚𝕠𝕟: #{fetch(:current_revision) || '<empty>'}[/code]
  )
end

.text(status) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/chatworkify/cw.rb', line 23

def text(status)
  case status
  when :starting
    fetch(:chatwork_deploy_starting_text)
  when :success
    fetch(:chatwork_deploy_succeed_text)
  when :failed
    fetch(:chatwork_deploy_failed_text)
  end
end