Class: Slackistrano::Messaging::Deprecated

Inherits:
Base
  • Object
show all
Defined in:
lib/slackistrano/messaging/deprecated.rb

Instance Attribute Summary

Attributes inherited from Base

#team, #token, #webhook

Instance Method Summary collapse

Methods inherited from Base

#payload_for, #via_slackbot?

Methods included from Helpers

#application, #branch, #elapsed_time, #stage

Constructor Details

#initialize(env: nil, team: nil, channel: nil, token: nil, webhook: nil) ⇒ Deprecated

Returns a new instance of Deprecated.



5
6
7
8
9
10
11
12
# File 'lib/slackistrano/messaging/deprecated.rb', line 5

def initialize(env: nil, team: nil, channel: nil, token: nil, webhook: nil)
  run_locally do
    warn("[slackistrano] You are using an outdated configuration that will be removed soon.")
    warn("[slackistrano] Please upgrade soon! <https://github.com/phallstrom/slackistrano>")
  end

  super
end

Instance Method Details

#channels_for(action) ⇒ Object



30
31
32
# File 'lib/slackistrano/messaging/deprecated.rb', line 30

def channels_for(action)
  fetch("slack_channel_#{action}".to_sym) || super
end

#deployerObject



26
27
28
# File 'lib/slackistrano/messaging/deprecated.rb', line 26

def deployer
  fetch("slack_deploy_user".to_sym) || super
end

#icon_emojiObject



18
19
20
# File 'lib/slackistrano/messaging/deprecated.rb', line 18

def icon_emoji
  fetch("slack_icon_emoji".to_sym) || super
end

#icon_urlObject



14
15
16
# File 'lib/slackistrano/messaging/deprecated.rb', line 14

def icon_url
  fetch("slack_icon_url".to_sym) || super
end

#payload_for_failedObject



50
51
52
# File 'lib/slackistrano/messaging/deprecated.rb', line 50

def payload_for_failed
  make_message(__method__, super.merge(color: 'danger'))
end

#payload_for_revertedObject



46
47
48
# File 'lib/slackistrano/messaging/deprecated.rb', line 46

def payload_for_reverted
  make_message(__method__, super.merge(color: 'warning'))
end

#payload_for_revertingObject



38
39
40
# File 'lib/slackistrano/messaging/deprecated.rb', line 38

def payload_for_reverting
  make_message(__method__, super)
end

#payload_for_updatedObject



42
43
44
# File 'lib/slackistrano/messaging/deprecated.rb', line 42

def payload_for_updated
  make_message(__method__, super.merge(color: 'good'))
end

#payload_for_updatingObject



34
35
36
# File 'lib/slackistrano/messaging/deprecated.rb', line 34

def payload_for_updating
  make_message(__method__, super)
end

#usernameObject



22
23
24
# File 'lib/slackistrano/messaging/deprecated.rb', line 22

def username
  fetch("slack_username".to_sym) || super
end