Rubocop redundant return fix

This commit is contained in:
Penar Musaraj 2019-11-14 15:03:49 -05:00
parent bf6f66ada8
commit 6fcf381751
9 changed files with 13 additions and 13 deletions

View File

@ -18,7 +18,7 @@ module DiscourseChat::Provider::FlowdockProvider
req.body = message.to_json req.body = message.to_json
response = http.request(req) response = http.request(req)
return response response
end end
def self.generate_flowdock_message(post, flow_token) def self.generate_flowdock_message(post, flow_token)
@ -45,7 +45,7 @@ module DiscourseChat::Provider::FlowdockProvider
} }
} }
return message message
end end
def self.trigger_notification(post, channel) def self.trigger_notification(post, channel)

View File

@ -28,7 +28,7 @@ module DiscourseChat
req.body = message.to_json req.body = message.to_json
response = http.request(req) response = http.request(req)
return response response
end end
def self.generate_matrix_message(post) def self.generate_matrix_message(post)
@ -53,7 +53,7 @@ module DiscourseChat
} }
return message message
end end
def self.trigger_notification(post, channel) def self.trigger_notification(post, channel)

View File

@ -43,7 +43,7 @@ module DiscourseChat::Provider::MattermostProvider
# Create channel if doesn't exist # Create channel if doesn't exist
channel ||= DiscourseChat::Channel.create!(provider: provider, data: { identifier: channel_id }) channel ||= DiscourseChat::Channel.create!(provider: provider, data: { identifier: channel_id })
return ::DiscourseChat::Helper.process_command(channel, tokens) ::DiscourseChat::Helper.process_command(channel, tokens)
end end

View File

@ -44,7 +44,7 @@ module DiscourseChat::Provider::RocketchatProvider
message[:attachments].push(summary) message[:attachments].push(summary)
return message message
end end
def self.send_via_webhook(message) def self.send_via_webhook(message)

View File

@ -100,7 +100,7 @@ module DiscourseChat::Provider::SlackProvider
response = http.request(req) response = http.request(req)
end end
return { text: I18n.t("chat_integration.provider.slack.transcript.loading") } { text: I18n.t("chat_integration.provider.slack.transcript.loading") }
end end
def interactive def interactive

View File

@ -70,7 +70,7 @@ module DiscourseChat::Provider::SlackProvider
message[:attachments].push(summary) message[:attachments].push(summary)
return message message
end end
def self.send_via_api(post, channel, message) def self.send_via_api(post, channel, message)

View File

@ -80,7 +80,7 @@ module DiscourseChat::Provider::TelegramProvider
tokens[0][0] = '' # Remove the slash from the first token tokens[0][0] = '' # Remove the slash from the first token
tokens[0] = tokens[0].split('@')[0] # Remove the bot name from the command (necessary for group chats) tokens[0] = tokens[0].split('@')[0] # Remove the bot name from the command (necessary for group chats)
return ::DiscourseChat::Helper.process_command(channel, tokens) ::DiscourseChat::Helper.process_command(channel, tokens)
end end
def telegram_token_valid? def telegram_token_valid?

View File

@ -29,7 +29,7 @@ module DiscourseChat
end end
def self.sendMessage(message) def self.sendMessage(message)
return self.do_api_request('sendMessage', message) self.do_api_request('sendMessage', message)
end end
def self.do_api_request(methodName, message) def self.do_api_request(methodName, message)
@ -46,7 +46,7 @@ module DiscourseChat
responseData = JSON.parse(response.body) responseData = JSON.parse(response.body)
return responseData responseData
end end
def self.message_text(post) def self.message_text(post)
@ -69,7 +69,7 @@ module DiscourseChat
tags = topic.tags.map(&:name).join(', ') tags = topic.tags.map(&:name).join(', ')
end end
return I18n.t( I18n.t(
"chat_integration.provider.telegram.message", "chat_integration.provider.telegram.message",
user: display_name, user: display_name,
post_url: post.full_url, post_url: post.full_url,

View File

@ -22,7 +22,7 @@ module DiscourseChat
response = http.request(req) response = http.request(req)
return response response
end end
def self.generate_zulip_message(post, stream, subject) def self.generate_zulip_message(post, stream, subject)