debian-mirror-gitlab/lib/gitlab/slash_commands/issue_show.rb

26 lines
560 B
Ruby
Raw Normal View History

2018-12-23 12:14:25 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Gitlab
2017-09-10 17:25:29 +05:30
module SlashCommands
2017-08-17 22:00:37 +05:30
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
2017-09-10 17:25:29 +05:30
Gitlab::SlashCommands::Presenters::IssueShow.new(issue).present
2017-08-17 22:00:37 +05:30
else
2017-09-10 17:25:29 +05:30
Gitlab::SlashCommands::Presenters::Access.new.not_found
2017-08-17 22:00:37 +05:30
end
end
end
end
end