gitlab-org--gitlab-foss/lib/gitlab/slash_commands/help.rb

29 lines
611 B
Ruby
Raw Normal View History

2017-01-11 09:04:49 -05:00
module Gitlab
module SlashCommands
2017-01-11 09:04:49 -05:00
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
2017-01-30 06:12:57 -05:00
def execute(commands, text)
Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
2017-01-11 09:04:49 -05:00
end
def trigger
params[:command]
end
end
end
end