summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat_commands/help.rb
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-04 14:56:27 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-04 14:56:27 +0100
commitccca73d779ae0e22a86c9586fd52b15a8600b9f3 (patch)
tree7385d9a2019bfa98affe9bc83c0afd7da2fd730d /lib/gitlab/chat_commands/help.rb
parentc252c03401881fd7dbf7fab984285c402eb31d5f (diff)
parent5f7ebfb9aa023849b8b296bf9cf0f472b886d072 (diff)
downloadgitlab-ce-ccca73d779ae0e22a86c9586fd52b15a8600b9f3.tar.gz
Merge branch 'master' into add-sentry-js-again-with-vue
Diffstat (limited to 'lib/gitlab/chat_commands/help.rb')
-rw-r--r--lib/gitlab/chat_commands/help.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/gitlab/chat_commands/help.rb b/lib/gitlab/chat_commands/help.rb
new file mode 100644
index 00000000000..6c0e4d304a4
--- /dev/null
+++ b/lib/gitlab/chat_commands/help.rb
@@ -0,0 +1,28 @@
+module Gitlab
+ module ChatCommands
+ class Help < BaseCommand
+ # This class has to be used last, as it always matches. It has to match
+ # because other commands were not triggered and we want to show the help
+ # command
+ def self.match(_text)
+ true
+ end
+
+ def self.help_message
+ 'help'
+ end
+
+ def self.allowed?(_project, _user)
+ true
+ end
+
+ def execute(commands, text)
+ Gitlab::ChatCommands::Presenters::Help.new(commands).present(trigger, text)
+ end
+
+ def trigger
+ params[:command]
+ end
+ end
+ end
+end