Sha256: 3d893e1bd34971a177fe2f5d07eca131e29cc04de146d17342c9bb0c1f146990

Contents?: true

Size: 1.24 KB

Versions: 45

Compression:

Stored size: 1.24 KB

Contents

module MetaProject
  module Tracker
    # This module should be included by trackers that follow a digit-based issue scheme.
    # TODO: Make issue_pattern and command_pattern attributes so they can be modified. Provide examples.
    module DigitIssues
      # Patois issue pattern
      def issue_pattern
        @issue_pattern ||= /\#([\d]+)/
      end
      module_function :issue_pattern

      # Patois command pattern
      def command_pattern
        @command_pattern ||= /([A-Za-z]*).?(\#[\d]+(?:(?:[, &]*|\s?and\s?)\#[\d]+)*)/
      end
      module_function :command_pattern

      def identifier_examples
        ["#1926", "#1446"]
      end

      # TODO: find a way to extract just the issue summaries so they can be stored in dc as an array
      # embedded in the revision object. that way we don't alter the original commit message
      def markup(text)
        text.gsub(issue_pattern) do |match|
          issue_identifier = $1
          issue = issue(issue_identifier)
          link_text = (issue && issue.summary && issue.summary.strip! != "") ? "#{issue_identifier}: #{issue.summary}" : issue_identifier
          (issue && issue.url) ? "<a href=\"#{issue.url}\">\##{link_text}</a>" : "\##{issue_identifier}"
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
redcar-dev-0.12.1dev-java lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-dev-0.12.0dev-java lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.11 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.11.0dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.10 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.9.2 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.9.1 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.9.0 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.8.1 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.8 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.7 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.6.1 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.6 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.6.1dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5.1 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5 lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5.6dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5.5dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5.4dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb
redcar-0.5.3dev lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb