summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat_commands/issue_search.rb
blob: 51bf80c800b73f4fe09292859b8f68e91b16ac29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Gitlab
  module ChatCommands
    class IssueSearch < IssueCommand
      def self.match(text)
        /\Aissue\s+search\s+(?<query>.*)/.match(text)
      end

      def self.help_message
        "issue search <your query>"
      end

      def execute(match)
        collection.search(match[:query]).limit(QUERY_LIMIT)
      end
    end
  end
end