15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/make_release/story.rb', line 15
def split_story( description = @description )
raise RuntimeError 'description cannot be blank' unless description
stories = []
story_pattern = /\[?(((SRMPRT|OSMCLOUD)\-\d+)|NO-JIRA)\]?[,:\-\s]+\s*(.*)$/
line = description.match(story_pattern)
if line.nil?
stories.push 'NO-JIRA'
desc = description.strip
else
stories.push line.captures[0]
desc = line.captures[3].strip
end
if desc =~ story_pattern
new_story, new_desc = split_story desc
stories.push new_story
desc = new_desc
end
[stories.flatten, desc]
end
|