v2gpti 1.1.6 → 1.1.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: d32c53700d4c10eed175e334f2fa5d88be21255d
4
- data.tar.gz: 417da34d4ac4214d7c17f3eec25463b9e275a581
3
+ metadata.gz: 407115cdfe7f437aeaf30bc325ef59b20635004e
4
+ data.tar.gz: 87b290c0c989eac656f421fb3f27420cabaa5bee
5
5
  SHA512:
6
- metadata.gz: 278245d35a288d71ac3bb536a5acd5f440468fde46bb6b3843a0109e542183bb2e18b4d4c9a49a891e77c7eae7e451d5b62e7e7a00e03e4a384ed4958de14e04
7
- data.tar.gz: 334395c82849448aeaedcaf21edd88e4fbb5d33cc1b3827db3620e3aa9ac20cef8eb9145bdaf301ce42ef2118670e1e3168f4d6e0809dc2c69031dfb5f34e2c1
6
+ metadata.gz: e775a908da1c9deb527fb2f6a32c02c67cbfcd70bc136a02f3de488781d884d5950d293267a70ff8ada28bd7a14713a4f684357474e139d7e36ebf8532c2b39b
7
+ data.tar.gz: da3003f9db12d75815967a7c7204ab054370fe8235c515ddc2909170db3d4dd3ef1931b97036b4888b0a9ff654945b7ea43f5c048fa395aebf5d7d4a97655945
@@ -216,8 +216,10 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
216
216
  stories.reverse!
217
217
 
218
218
  stories.each do |story|
219
- if not_accepted_releases.size == 1
219
+ if not_accepted_releases.size == 1 && !last_accepted_release_story.nil?
220
220
  story.move(:after, last_accepted_release_story)
221
+ elsif previous_story.current_state == 'accepted'
222
+ story.move(:after, not_accepted_releases[not_accepted_releases.size - 2])
221
223
  else
222
224
  story.move(:after, previous_story)
223
225
  end
@@ -36,6 +36,8 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
36
36
  def run(filter)
37
37
  $LOG.debug("#{self.class} in project:#{@project.name} pwd:#{pwd} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
38
38
  story = GitPivotalTrackerIntegration::Util::Story.select_release(@project, filter.nil? ? 'v' : filter)
39
+ place_version_release story
40
+ pull_out_rejected_stories story
39
41
  GitPivotalTrackerIntegration::Util::Story.pretty_print story
40
42
  $LOG.debug("story:#{story.name}")
41
43
 
@@ -99,7 +101,34 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
99
101
  story.update(:labels => s_labels_string)
100
102
 
101
103
  end
102
-
103
-
104
+
105
+ private
106
+
107
+ def place_version_release(release_story)
108
+ not_accepted_releases = nil
109
+ not_accepted_releases_ids = nil
110
+ not_accepted_releases = @project.stories.all(:current_state => 'unstarted', :story_type => 'release')
111
+ not_accepted_releases_ids = Array.new
112
+ not_accepted_releases.collect{|not_accepted_release| not_accepted_releases_ids.push not_accepted_release.id.to_i }
113
+ unless (not_accepted_releases_ids.include?(release_story.id))
114
+ not_accepted_releases << release_story
115
+ not_accepted_releases_ids.clear
116
+ not_accepted_releases.collect{|not_accepted_release| not_accepted_releases_ids.push not_accepted_release.id.to_i }
117
+ end
118
+ specified_pt_story = @project.stories.all(:current_state => ['unstarted', 'started', 'finished', 'delivered', 'rejected']).first
119
+ last_accepted_release_story=@project.stories.all(:current_state => 'accepted', :story_type => 'release').last
120
+ if not_accepted_releases.size > 1
121
+ release_story.move(:after, not_accepted_releases[not_accepted_releases.size - 2])
122
+ elsif !specified_pt_story.nil?
123
+ release_story.move(:before, specified_pt_story)
124
+ end
125
+ end
126
+
127
+ def pull_out_rejected_stories(release_story)
128
+ rejected_stories=@project.stories.all(:current_state => ['rejected'], :story_type => ['bug', 'chore', 'feature'])
129
+ rejected_stories.each{|rejected_story|
130
+ rejected_story.move(:after, release_story)
131
+ }
132
+ end
104
133
 
105
134
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: v2gpti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Wolski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-08-29 00:00:00.000000000 Z
13
+ date: 2014-09-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline