Class: Capistrano::Slacky::Facade::Header

Inherits:
Block::Header show all
Defined in:
lib/capistrano/slacky/facade/header.rb

Constant Summary collapse

DEPLOYED_SUCCESSFULLY =
[
  ":smile:",
  ":drooling_face:",
  ":sunglasses:",
  ":partying_face:",
  ":heart_eyes:",
  ":star-struck:",
  ":yum:"
].freeze
REVERTED_SUCCESSFULLY =
[
  ":upside_down_face:",
  ":pensive:",
  ":face_with_raised_eyebrow:",
  ":worried:",
  ":pleading_face:",
  ":shushing_face:"
].freeze
DEPLOYMENT_FAILED =
[
  ":grimacing:",
  ":face_with_head_bandage:",
  ":face_with_thermometer:",
  ":woozy_face:",
  ":exploding_head:",
  ":sob:",
  ":cry:",
  ":dizzy_face:",
  ":face_with_hand_over_mouth:",
  ":broken_heart:"
].freeze
ROLLBACK_FAILED =
DEPLOYMENT_FAILED
EMOJI_MAP =
{
  deployed_successfully: DEPLOYED_SUCCESSFULLY,
  reverted_successfully: REVERTED_SUCCESSFULLY,
  deployment_failed: DEPLOYMENT_FAILED,
  rollback_failed: ROLLBACK_FAILED
}.freeze

Instance Method Summary collapse

Methods inherited from Block::Header

#as_json

Constructor Details

#initialize(text) ⇒ Header

Returns a new instance of Header.



48
49
50
# File 'lib/capistrano/slacky/facade/header.rb', line 48

def initialize(text)
  super(::I18n.t("slacky.#{text}", scope: "capistrano", emoji: EMOJI_MAP.fetch(text).sample))
end