Sha256: 43a5056647b7a2b23d327841247c1ecefbe917c309754514789d118fc86cd189
Contents?: true
Size: 1009 Bytes
Versions: 45
Compression:
Stored size: 1009 Bytes
Contents
module MetaProject module Tracker module Jira # This module should be included by trackers that follow a digit-based issue scheme module JiraIssues # Patois issue pattern def issue_pattern /([A-Za-z]+-[\d]+)/ end module_function :issue_pattern # Patois command pattern def command_pattern /([A-Za-z]*).?([A-Za-z]+-[\d]+(?:(?:[, &]*|\s?and\s?)[A-Za-z]+-[\d]+)*)/ end module_function :command_pattern def identifier_examples ["DC-420", "pico-12"] end def markup(text) text.gsub(issue_pattern) do |match| issue_identifier = $1.upcase issue = issue(issue_identifier) link_text = (issue.summary && issue.summary.strip! != "") ? "#{issue_identifier}: #{issue.summary}" : issue_identifier issue.url ? "<a href=\"#{issue.url}\">#{link_text}</a>" : issue_identifier end end end end end end
Version data entries
45 entries across 45 versions & 3 rubygems