diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-22 15:05:52 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-22 15:05:52 +0200 |
commit | 97c42df3b804a37e659c3cda6bd8a52570f31366 (patch) | |
tree | 97c38db7f71a93a7b0db5ca2c682d6d17479cbdb /lib/gitlab/slash_commands/issue_show.rb | |
parent | 3833f1dd84dfec844443a5b1d9ba2bd2b911c0bc (diff) | |
parent | 11716f310dcc495600f5a17e08456a1abb296482 (diff) | |
download | gitlab-ce-28717-additional-metrics-review-branch.tar.gz |
Merge remote-tracking branch 'upstream/master' into 28717-additional-metrics-review-branch28717-additional-metrics-review-branch
Diffstat (limited to 'lib/gitlab/slash_commands/issue_show.rb')
-rw-r--r-- | lib/gitlab/slash_commands/issue_show.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gitlab/slash_commands/issue_show.rb b/lib/gitlab/slash_commands/issue_show.rb new file mode 100644 index 00000000000..ffa5184e5cb --- /dev/null +++ b/lib/gitlab/slash_commands/issue_show.rb @@ -0,0 +1,23 @@ +module Gitlab + module SlashCommands + class IssueShow < IssueCommand + def self.match(text) + /\Aissue\s+show\s+#{Issue.reference_prefix}?(?<iid>\d+)/.match(text) + end + + def self.help_message + "issue show <id>" + end + + def execute(match) + issue = find_by_iid(match[:iid]) + + if issue + Gitlab::SlashCommands::Presenters::IssueShow.new(issue).present + else + Gitlab::SlashCommands::Presenters::Access.new.not_found + end + end + end + end +end |