Class: TrackerGitHook::MessageGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker_git_hook/message_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate(original_message:, story_id:) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/tracker_git_hook/message_generator.rb', line 3

def generate(original_message:, story_id:)
  if message_is_tagged?(original_message)
    original_message
  else
    message_lines = original_message.split("\n")

    new_message = insert_into_message(message_lines, "[##{story_id}]")

    new_message.join("\n")
  end
end