Commit 4c595e9d authored by Justin Ho's avatar Justin Ho

Upgrade "slack-notifier" gem to 2.3.2

parent 59344b22
...@@ -237,7 +237,7 @@ gem 'atlassian-jwt', '~> 0.2.0' ...@@ -237,7 +237,7 @@ gem 'atlassian-jwt', '~> 0.2.0'
gem 'flowdock', '~> 0.7' gem 'flowdock', '~> 0.7'
# Slack integration # Slack integration
gem 'slack-notifier', '~> 1.5.1' gem 'slack-notifier', '~> 2.3.2'
# Hangouts Chat integration # Hangouts Chat integration
gem 'hangouts-chat', '~> 0.0.5' gem 'hangouts-chat', '~> 0.0.5'
......
...@@ -1021,7 +1021,7 @@ GEM ...@@ -1021,7 +1021,7 @@ GEM
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.2) simplecov-html (0.10.2)
sixarm_ruby_unaccent (1.2.0) sixarm_ruby_unaccent (1.2.0)
slack-notifier (1.5.1) slack-notifier (2.3.2)
snowplow-tracker (0.6.1) snowplow-tracker (0.6.1)
contracts (~> 0.7, <= 0.11) contracts (~> 0.7, <= 0.11)
spring (2.0.2) spring (2.0.2)
...@@ -1376,7 +1376,7 @@ DEPENDENCIES ...@@ -1376,7 +1376,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.0) sidekiq-cron (~> 1.0)
simple_po_parser (~> 1.1.2) simple_po_parser (~> 1.1.2)
simplecov (~> 0.16.1) simplecov (~> 0.16.1)
slack-notifier (~> 1.5.1) slack-notifier (~> 2.3.2)
snowplow-tracker (~> 0.6.1) snowplow-tracker (~> 0.6.1)
spring (~> 2.0.0) spring (~> 2.0.0)
spring-commands-rspec (~> 1.0.4) spring-commands-rspec (~> 1.0.4)
......
...@@ -59,7 +59,7 @@ module ChatMessage ...@@ -59,7 +59,7 @@ module ChatMessage
end end
def format(string) def format(string)
Slack::Notifier::LinkFormatter.format(format_relative_links(string)) Slack::Notifier::Util::LinkFormatter.format(format_relative_links(string))
end end
def format_relative_links(string) def format_relative_links(string)
......
...@@ -98,7 +98,7 @@ module ChatMessage ...@@ -98,7 +98,7 @@ module ChatMessage
def failed_stages_field def failed_stages_field
{ {
title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length), title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length),
value: Slack::Notifier::LinkFormatter.format(failed_stages_links), value: Slack::Notifier::Util::LinkFormatter.format(failed_stages_links),
short: true short: true
} }
end end
...@@ -106,7 +106,7 @@ module ChatMessage ...@@ -106,7 +106,7 @@ module ChatMessage
def failed_jobs_field def failed_jobs_field
{ {
title: s_("ChatMessage|Failed job").pluralize(failed_jobs.length), title: s_("ChatMessage|Failed job").pluralize(failed_jobs.length),
value: Slack::Notifier::LinkFormatter.format(failed_jobs_links), value: Slack::Notifier::Util::LinkFormatter.format(failed_jobs_links),
short: true short: true
} }
end end
...@@ -123,12 +123,12 @@ module ChatMessage ...@@ -123,12 +123,12 @@ module ChatMessage
fields = [ fields = [
{ {
title: ref_type == "tag" ? s_("ChatMessage|Tag") : s_("ChatMessage|Branch"), title: ref_type == "tag" ? s_("ChatMessage|Tag") : s_("ChatMessage|Branch"),
value: Slack::Notifier::LinkFormatter.format(ref_link), value: Slack::Notifier::Util::LinkFormatter.format(ref_link),
short: true short: true
}, },
{ {
title: s_("ChatMessage|Commit"), title: s_("ChatMessage|Commit"),
value: Slack::Notifier::LinkFormatter.format(commit_link), value: Slack::Notifier::Util::LinkFormatter.format(commit_link),
short: true short: true
} }
] ]
......
...@@ -48,7 +48,7 @@ module ChatMessage ...@@ -48,7 +48,7 @@ module ChatMessage
end end
def format(string) def format(string)
Slack::Notifier::LinkFormatter.format(string) Slack::Notifier::Util::LinkFormatter.format(string)
end end
def commit_messages def commit_messages
......
...@@ -36,7 +36,10 @@ class SlackService < ChatNotificationService ...@@ -36,7 +36,10 @@ class SlackService < ChatNotificationService
def notify(message, opts) def notify(message, opts)
# See https://github.com/stevenosloan/slack-notifier#custom-http-client # See https://github.com/stevenosloan/slack-notifier#custom-http-client
notifier = Slack::Notifier.new(webhook, opts.merge(http_client: HTTPClient)) notifier = Slack::Notifier.new(webhook) do
http_client HTTPClient
defaults opts
end
notifier.ping( notifier.ping(
message.pretext, message.pretext,
......
...@@ -29,6 +29,6 @@ class SlackSlashCommandsService < SlashCommandsService ...@@ -29,6 +29,6 @@ class SlackSlashCommandsService < SlashCommandsService
private private
def format(text) def format(text)
Slack::Notifier::LinkFormatter.format(text) if text Slack::Notifier::Util::LinkFormatter.format(text) if text
end end
end end
...@@ -63,7 +63,7 @@ module Gitlab ...@@ -63,7 +63,7 @@ module Gitlab
# Convert Markdown to slacks format # Convert Markdown to slacks format
def format(string) def format(string)
Slack::Notifier::LinkFormatter.format(string) Slack::Notifier::Util::LinkFormatter.format(string)
end end
def resource_url def resource_url
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment