-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
382 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative 'config/application' | ||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
default from: 'from@example.com' | ||
layout 'mailer' | ||
default from: "from@example.com" | ||
layout "mailer" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class Channel < ApplicationRecord | ||
self.primary_key = 'slack_channel_id' | ||
self.primary_key = "slack_channel_id" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class User < ApplicationRecord | ||
self.primary_key = 'slack_user_id' | ||
self.primary_key = "slack_user_id" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
module WhoIsOnDutyTodaySlackBotModule | ||
module Commands | ||
class ActionCreate | ||
def self.call(client:,data:,match:) | ||
def self.call(client:, data:, match:) | ||
action = Action.new( | ||
problem: match['expression'][/problem:(.*) action:/, 1], | ||
action: match['expression'][/ action:(.*)$/, 1], | ||
problem: match["expression"][/problem:(.*) action:/, 1], | ||
action: match["expression"][/ action:(.*)$/, 1], | ||
channel: data.channel | ||
) | ||
|
||
if action.save | ||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.action.created.text'), | ||
text: I18n.t("commands.action.created.text"), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
else | ||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.action.failed.text'), | ||
text: I18n.t("commands.action.failed.text"), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
module WhoIsOnDutyTodaySlackBotModule | ||
module Commands | ||
class ActionDelete | ||
def self.call(client:,data:,match:) | ||
def self.call(client:, data:, match:) | ||
Action.where( | ||
problem: match['expression'][/problem:(.*)/, 1], | ||
problem: match["expression"][/problem:(.*)/, 1], | ||
channel: data.channel | ||
).delete_all | ||
|
||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.action.deleted.text'), | ||
text: I18n.t("commands.action.deleted.text"), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
module WhoIsOnDutyTodaySlackBotModule | ||
module Commands | ||
class AnswerDeleteCustomText | ||
def self.call(client:,data:) | ||
def self.call(client:, data:) | ||
Answer.where(channel_id: data.channel).delete_all | ||
|
||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.answer.deleted.text'), | ||
text: I18n.t("commands.answer.deleted.text"), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module WhoIsOnDutyTodaySlackBotModule | ||
module Commands | ||
class AnswerDisableHideReason | ||
def self.call(client:,data:) | ||
def self.call(client:, data:) | ||
Answer.where(channel_id: data.channel).update_all(hide_reason: false) | ||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.disable.hide_reason.text', name: client.self.name), | ||
text: I18n.t("commands.disable.hide_reason.text", name: client.self.name), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
module WhoIsOnDutyTodaySlackBotModule | ||
module Commands | ||
class AnswerEnableHideReason | ||
def self.call(client:,data:) | ||
def self.call(client:, data:) | ||
if Answer.where(channel_id: data.channel).update_all(hide_reason: true) | ||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.enable.hide_reason.text', name: client.self.name), | ||
text: I18n.t("commands.enable.hide_reason.text", name: client.self.name), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
else | ||
client.web_client.chat_postMessage( | ||
channel: data.channel, | ||
text: I18n.t('commands.enable.hide_reason.failed.text', name: client.self.name), | ||
text: I18n.t("commands.enable.hide_reason.failed.text", name: client.self.name), | ||
thread_ts: data.thread_ts || data.ts, | ||
as_user: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.