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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c09441aca3f3edcf71fdda17ddcb33a211bb5626
4
- data.tar.gz: ee0db92cf08dc80d4283e03ff45d11c81d2f5fe8
3
+ metadata.gz: 93c2d862a41d406b2a7db7f3ddfc264d63e15555
4
+ data.tar.gz: de893109c5638ceca11b57cd01afa3c3ca94aa72
5
5
  SHA512:
6
- metadata.gz: fae795326dad9be1d7713b45b84a21842f6ab7c1d819df6265daaf72da3fc0267ddd4d03d580e543f3417c29681a2a031ed1c61318394c758ad4d2aa995e2e2e
7
- data.tar.gz: b556a99549286699d243004ceccf6cb0ee2cefd48b9ebd79e5d8fc6e2740cb9baf4cdf97c350e4accd5182dabf859ce64759f155532e8149366b9a0bb672a77b
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
- # only grab the line with the lighthouse info
53
- # or the first line if no lighthouse info
54
- commits = commits.collect do |x|
55
- lines = x.split("\n")
56
- lines.select { |y| y =~ /\[#\d+/ }.first || lines.first
57
- end.compact
58
- # rid of clean up ticket format [#1234 state:xxx]
59
- commits = commits.map do |x|
60
- x.gsub(/\[#(\d+)(.*)\]/, '\1')
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
- @commits = commits.uniq.sort
62
+ tickets
63
63
  end
64
64
 
65
65
  def commits_list
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.6.6"
2
+ VERSION = "0.6.7"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gantree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix