v2gpti 1.1.0 → 1.1.1

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: 4bdffa3f751ba70b4294b507f65a7c3f6674568d
4
- data.tar.gz: f8bc500b92c556a783be55b4e72e3495738f2d56
3
+ metadata.gz: c6e841960ee2e72e5ad3b18f677b1c65c8f59505
4
+ data.tar.gz: 1a7d28cfb47ae45f9e1d17041bd0188efcee8680
5
5
  SHA512:
6
- metadata.gz: 98c1e7fe0b651c23052b69eb842f5899622da3109275097a0cb2258e485c594b864c1f0371efb64f52495613b40f4e016eeb1c0a96ad073cf4a7e4b4968cf47b
7
- data.tar.gz: d2f52f333ddca3fe06e2951142a06d8e57fed152b4a43bfdd4d53773fc92e542c24f996f6d1003cb2c6ba2388d845e0cf432561a3bcd6700de9f77db04963582
6
+ metadata.gz: 31a93fb8e2d725c0f224ba22a208aa4cf6d8edf50cbc2385ab67c6394635acd520931d21fe332b4bdede4499a3d9d13566d0ff6aac86fb3446c851f221b6d299
7
+ data.tar.gz: dabf84782ec085a1aa62c5cdc7062add32fdfcf8ddf0b118368ad5004a62ede0b94cdd381c734092a131d898b5976bef933277825a31523918827064f14b342e
@@ -38,7 +38,7 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
38
38
  self.check_branch
39
39
  story = GitPivotalTrackerIntegration::Util::Story.select_release @project
40
40
  $LOG.debug("story:#{story.name}")
41
-
41
+ sort_for_deliver story
42
42
  GitPivotalTrackerIntegration::Util::Story.pretty_print story
43
43
 
44
44
  current_branch = GitPivotalTrackerIntegration::Util::Git.branch_name
@@ -85,7 +85,6 @@ class GitPivotalTrackerIntegration::Command::Deliver < GitPivotalTrackerIntegrat
85
85
 
86
86
  i_stories = included_stories @project, story
87
87
  deliver_stories i_stories, story
88
-
89
88
  end
90
89
 
91
90
  def check_branch
@@ -118,7 +117,7 @@ def deliver_stories(stories, build_story)
118
117
  all_stories = stories.dup
119
118
  all_stories << build_story
120
119
  all_stories.each {|story|
121
- puts "story class:#{story.class}"
120
+ # puts "story class:#{story.class}"
122
121
  s_labels_string = story.labels
123
122
  s_labels = ""
124
123
  if (s_labels_string)
@@ -129,7 +128,7 @@ def deliver_stories(stories, build_story)
129
128
  s_labels_string = build_story.name
130
129
  end
131
130
 
132
- puts "labels:#{s_labels_string}"
131
+ # puts "labels:#{s_labels_string}"
133
132
  story.update(:labels => s_labels_string)
134
133
  if (story.story_type == "feature") || (story.story_type == "bug")
135
134
  story.update(:current_state => "delivered")
@@ -202,4 +201,17 @@ end
202
201
  puts 'OK'
203
202
  end
204
203
 
204
+ def sort_for_deliver(release_story)
205
+ last_release = GitPivotalTrackerIntegration::Util::Story.last_release_story(@project, "b")
206
+ stories = included_stories(@project, release_story)
207
+ stories << release_story
208
+ previous_story = last_release.dup
209
+ puts "Last release:#{previous_story.name}"
210
+ stories.each {|story|
211
+ story.move(:after, previous_story)
212
+ previous_story = story.dup
213
+ }
214
+
215
+ a=1
216
+ end
205
217
  end
@@ -81,7 +81,18 @@ class GitPivotalTrackerIntegration::Command::Release < GitPivotalTrackerIntegrat
81
81
  puts GitPivotalTrackerIntegration::Util::Shell.exec "git push"
82
82
  puts GitPivotalTrackerIntegration::Util::Shell.exec "git checkout #{current_branch}"
83
83
 
84
+ s_labels_string = story.labels
85
+ s_labels = ""
86
+ if (s_labels_string)
87
+ s_labels = s_labels_string.split(",")
88
+ s_labels << story.name
89
+ s_labels_string = s_labels.uniq.join(",")
90
+ else
91
+ s_labels_string = story.name
92
+ end
84
93
 
94
+ puts "labels:#{s_labels_string}"
95
+ story.update(:labels => s_labels_string)
85
96
 
86
97
  end
87
98
 
@@ -37,6 +37,9 @@ class GitPivotalTrackerIntegration::Command::Start < GitPivotalTrackerIntegratio
37
37
  $LOG.debug("#{self.class} in project:#{@project.name} pwd:#{(GitPivotalTrackerIntegration::Util::Shell.exec 'pwd').chop} branch:#{GitPivotalTrackerIntegration::Util::Git.branch_name}")
38
38
  self.check_branch
39
39
  story = GitPivotalTrackerIntegration::Util::Story.select_story @project, filter
40
+ if story.nil?
41
+ abort
42
+ end
40
43
  $LOG.debug("story:#{story.name}")
41
44
  GitPivotalTrackerIntegration::Util::Story.pretty_print story
42
45
 
@@ -171,7 +171,7 @@ class GitPivotalTrackerIntegration::Util::Story
171
171
  puts
172
172
  else
173
173
  if type == "release"
174
- last_release_number = last_release(project, release_type)
174
+ last_release_number = last_release_story(project, release_type).name
175
175
  last_release_type_string = (release_type == "b")?"build":"version"
176
176
  puts "There are no available release stories. The last #{last_release_type_string} release was #{last_release_number}."
177
177
  next_release_number = ask("To create a new #{last_release_type_string}, enter a name for the new release story:")
@@ -186,21 +186,22 @@ class GitPivotalTrackerIntegration::Util::Story
186
186
  story
187
187
  end
188
188
 
189
- def self.last_release (project, release_type)
189
+ def self.last_release_story (project, release_type)
190
190
  criteria = {
191
- :story_type => "release"
191
+ :story_type => "release"
192
192
  }
193
193
 
194
194
  candidates = project.stories.all criteria
195
- candidates = candidates.select {|x| x.name[0]==release_type}
195
+ candidates = candidates.select {|x| (x.name[0]==release_type) && !(x.labels.nil? || (!x.labels.include?x.name))}
196
196
 
197
- candidates[-1].name
197
+ candidates[-1]
198
198
  end
199
199
 
200
200
  def self.create_new_release (project, next_release_number)
201
201
  new_story = PivotalTracker::Story.new
202
202
  new_story.project_id = project.id
203
203
  new_story.story_type = "release"
204
+ new_story.current_state = "unstarted"
204
205
  new_story.name = next_release_number
205
206
 
206
207
  uploaded_story = new_story.create
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.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hale
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-18 00:00:00.000000000 Z
12
+ date: 2014-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline