gantree 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gantree/release_notes.rb +11 -11
- data/lib/gantree/version.rb +1 -1
- data/spec/lib/gantree/1_release_notes_spec.rb +22 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93c2d862a41d406b2a7db7f3ddfc264d63e15555
|
4
|
+
data.tar.gz: de893109c5638ceca11b57cd01afa3c3ca94aa72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916e8f901a7874a7bb9ad8c389d814a378b42e7f47676f192bb04a34825ceda9431154446819a1e1cb3d44199f54b55a8d11f161175564d5a1b5870197ca075d
|
7
|
+
data.tar.gz: 302529bb96a5aca54632cc8e8399cba56900203032e8679eef1d4920aa58906bb3716b6152342896ec344d5635c4fae03f06abb248fc957663533fcc870e1ffc
|
@@ -48,18 +48,18 @@ module Gantree
|
|
48
48
|
# Get commits for this release
|
49
49
|
commits = git_log
|
50
50
|
commits = commits.split("COMMIT_SEPARATOR")
|
51
|
-
commits = commits.collect { |x| x.strip }
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
51
|
+
commits = commits.collect { |x| x.strip }.reject {|x| x.empty? }
|
52
|
+
tickets = []
|
53
|
+
commits.each do |msg|
|
54
|
+
md = msg.match(/(\w+-\d+)/)
|
55
|
+
if md
|
56
|
+
ticket_id = md[1]
|
57
|
+
tickets << msg unless tickets.detect {|t| t =~ Regexp.new("^#{ticket_id}") }
|
58
|
+
else
|
59
|
+
tickets << msg
|
60
|
+
end
|
61
61
|
end
|
62
|
-
|
62
|
+
tickets
|
63
63
|
end
|
64
64
|
|
65
65
|
def commits_list
|
data/lib/gantree/version.rb
CHANGED
@@ -49,4 +49,26 @@ describe Gantree::ReleaseNotes do
|
|
49
49
|
expect(commits).to include("commit 1")
|
50
50
|
expect(commits).to include("commit 2")
|
51
51
|
end
|
52
|
+
|
53
|
+
it "should dedup the duplicate tickets from notes" do
|
54
|
+
git_log_mock = <<-EOL
|
55
|
+
CMS-296 sortable tweaks
|
56
|
+
COMMIT_SEPARATOR
|
57
|
+
CMS-296 tweak test to match implementation
|
58
|
+
COMMIT_SEPARATOR
|
59
|
+
CMS-423 Edit Content modal waits for Preview object to be fetched
|
60
|
+
COMMIT_SEPARATOR
|
61
|
+
CMS-423 WIP PreviewView area read from/write to area of tracks' embed code
|
62
|
+
COMMIT_SEPARATOR
|
63
|
+
EOL
|
64
|
+
|
65
|
+
allow(@rn).to receive(:git_log).and_return(git_log_mock)
|
66
|
+
commits = @rn.commits
|
67
|
+
p commits if ENV['DEBUG']
|
68
|
+
expect(commits).to be_a(Array)
|
69
|
+
expect(commits.size).to eq 2
|
70
|
+
expect(commits).to include("CMS-296 sortable tweaks")
|
71
|
+
expect(commits).to include("CMS-423 Edit Content modal waits for Preview object to be fetched")
|
72
|
+
expect(commits).to_not include("CMS-423 WIP PreviewView area read from/write to area of tracks' embed code")
|
73
|
+
end
|
52
74
|
end
|