Module: Commit2Jira
- Defined in:
- lib/commit2jira.rb
Class Method Summary collapse
Class Method Details
.from_message(projects, message, precise_match = false, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/commit2jira.rb', line 5 def (projects, , precise_match=false, &block) if .nil? or .empty? return end if precise_match = .split("\n").select {|line| line =~ /\Ajira:/i }.join("\n") end regex = /\b(#{projects.join('|')})-(\d+)\b/i .scan(regex) do |match| project = match[0].upcase number = match[1].to_i yield project, number end end |