# rubocop:disable Style/CaseEquality # rubocop:disable Style/MultilineTernaryOperator # rubocop:disable Style/NestedTernaryOperator module Fastlane module Notification class Mattermost def initialize(webhook_url) @webhook_url = webhook_url @client = Faraday.new do | conn | conn.use(Faraday::Response::RaiseError) end end def post_incoming_webhook(channel:, username:, attachments:, icon_url:) @client.post(@webhook_url) do | request | request.headers['Content-Type'] = 'application/json' request.body = { channel: channel, username: username, icon_url: icon_url, attachments: attachments }.to_json end end class LinkFormatter HTML_PATTERN = %r{#{URI.regexp})['"].*?>(?