Sha256: 76346808ecdb4d5c268f482983d70d5ffa1fc0fabf277c962ad3c744e9be2de9
Contents?: true
Size: 739 Bytes
Versions: 12
Compression:
Stored size: 739 Bytes
Contents
module Atlassian module Util module TextUtil def convert_branch_name_to_sentence(branch_name) return '' if branch_name.nil? branch_name = branch_name.to_s return '' if branch_name.empty? issue_key_regex = /([A-Z]{1,10}-\d+)/ branch_components = branch_name.split(issue_key_regex); parts = branch_components.each_with_index.map { |value, index| (index % 2 === 0) ? value.gsub(/[\-_]/, ' ') : value } to_sentence_case(parts.join('')) end def to_sentence_case(str) return '' if str.nil? str = str.to_s return '' if str.empty? str.slice(0, 1).upcase + str.slice(1, str.length) end end end end
Version data entries
12 entries across 12 versions & 3 rubygems