pt-flow 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1383db0246599cfecba2fe73fc784b868f4e2639
4
- data.tar.gz: e11d6c527961ee229e531ef86cafb1da34cdbd0f
3
+ metadata.gz: 768dff4a6a274534a3dfe9fb6af7d7bfc5c99feb
4
+ data.tar.gz: ca496ea954994659d003b93c96e92a96753a7607
5
5
  SHA512:
6
- metadata.gz: 1481f08cfcebd792ae88b5c72323a013e443beb0b53cb1ac6b347afe7b9532a0405bb769374b4443303acac8bdaa39955b7688d4c993108fccf12edd0f8c27b7
7
- data.tar.gz: 2f3495368acf1f9b9fab00b720274e92f2274922e583e4bf1519aacb9f3d3a582e50443135080b55574469a448e97d5f40c70e9c7eb6262e9acc444c2463db9d
6
+ metadata.gz: 97757922cf2bb03bce2e1727620b11fdc4e4bfcd76cdd90b93bad4410d424f28cd521bbd4f60d5662149a37a99c08372ffabd92c769c7f731c5e5c4c69a68fcc
7
+ data.tar.gz: b822ef71c4033f5fdca6de7fc99c9f055b9e3303108435cd08d59c3601d47ff3c52e8dbb6ec32ddc47faca392633a5f7683a276272c4a4e450791c489c49cc13
data/lib/pt-flow/ui.rb CHANGED
@@ -34,12 +34,9 @@ module PT::Flow
34
34
 
35
35
  def finish
36
36
  run("git push origin #{branch} -u")
37
- task = PivotalTracker::Story.find(branch.task_id, @project.id)
38
- title = task.name.gsub('"',"'") + " [Delivers ##{task.id}]"
39
-
40
- run("hub pull-request -b #{branch.target} -h #{repo.user}:#{branch} -m \"#{title}\"")
41
- finish_task(task)
42
- merge! if @params.include?('--merge')
37
+ run("hub pull-request -b #{branch.target} -h #{repo.user}:#{branch} -m \"#{task_title}\"")
38
+ finish_task(current_task)
39
+ deliver! if @params.include?('--deliver')
43
40
  end
44
41
 
45
42
  def cleanup
@@ -80,11 +77,20 @@ module PT::Flow
80
77
  end
81
78
  end
82
79
 
83
- def merge!
80
+ def current_task
81
+ PivotalTracker::Story.find(branch.task_id, @project.id)
82
+ end
83
+
84
+ def task_title
85
+ current_task.name.gsub('"',"'") + " [Delivers ##{current_task.id}]"
86
+ end
87
+
88
+ def deliver!
84
89
  finished_branch = branch
90
+ title = task_title
85
91
  run "git checkout #{finished_branch.target}"
86
92
  run "git pull"
87
- run "git merge #{finished_branch}"
93
+ run "git merge #{finished_branch} --no-ff -m \"#{title}\""
88
94
  run "git push origin #{finished_branch.target}"
89
95
  end
90
96
 
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -95,15 +95,15 @@ module PT::Flow
95
95
  end
96
96
  end
97
97
 
98
- context 'given option --merge' do
98
+ context 'given option --deliver' do
99
99
  it "pushes the current branch to origin, flags the story as finished, opens github pull request, merges it in and returns to master and pulls" do
100
100
  UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
101
101
  UI.any_instance.should_receive(:run).with("hub pull-request -b new_feature -h cookpad:new_feature.this-is-for-comments.4460038 -m \"This is for comments [Delivers #4460038]\"")
102
102
  UI.any_instance.should_receive(:run).with('git checkout new_feature')
103
103
  UI.any_instance.should_receive(:run).with('git pull')
104
- UI.any_instance.should_receive(:run).with('git merge new_feature.this-is-for-comments.4460038')
104
+ UI.any_instance.should_receive(:run).with("git merge new_feature.this-is-for-comments.4460038 --no-ff -m \"This is for comments [Delivers #4460038]\"")
105
105
  UI.any_instance.should_receive(:run).with('git push origin new_feature')
106
- UI.new('finish', ['--merge'])
106
+ UI.new('finish', ['--deliver'])
107
107
  end
108
108
  end
109
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pt-flow
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
  - Jens Balvig