socialcast-git-extensions 3.0.4 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -131,7 +131,14 @@ module Socialcast
131
131
  removed_branches = reset_branch(bad_branch, good_branch)
132
132
  reset_branch("last_known_good_#{bad_branch}", good_branch) unless "last_known_good_#{bad_branch}" == good_branch
133
133
 
134
- post "#worklog resetting #{bad_branch} branch to #{good_branch} #scgitx\n\nthe following branches were affected:\n#{removed_branches.map{|b| '* ' + b}.join("\n") }"
134
+ message_parts = []
135
+ message_parts << "#worklog resetting #{bad_branch} branch to #{good_branch} #scgitx"
136
+ if removed_branches.any?
137
+ message_parts << ""
138
+ message_parts << "the following branches were affected:"
139
+ messgae_parts += removed_branches.map{|b| '* ' + b}
140
+ end
141
+ post message_parts.join("\n")
135
142
  end
136
143
 
137
144
  desc 'release', 'release the current branch to production'
@@ -144,7 +151,7 @@ module Socialcast
144
151
  update
145
152
  integrate_branch branch, Socialcast::Gitx::BASE_BRANCH
146
153
  run_cmd "git checkout #{Socialcast::Gitx::BASE_BRANCH}"
147
- invoke :integrate, ['staging', '--quiet']
154
+ integrate_branch('master', 'staging')
148
155
  cleanup
149
156
 
150
157
  post "#worklog releasing #{branch} to production #scgitx"
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "3.0.4"
3
+ VERSION = "3.0.5"
4
4
  end
5
5
  end
data/spec/cli_spec.rb CHANGED
@@ -21,8 +21,10 @@ describe Socialcast::Gitx::CLI do
21
21
 
22
22
  describe '#update' do
23
23
  before do
24
+ Socialcast::Gitx::CLI.any_instance.should_not_receive(:post)
24
25
  Socialcast::Gitx::CLI.start ['update']
25
26
  end
27
+ it 'should not post message to socialcast' do end # see expectations
26
28
  it 'should run expected commands' do
27
29
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
28
30
  'git pull origin FOO',
@@ -35,8 +37,10 @@ describe Socialcast::Gitx::CLI do
35
37
  describe '#integrate' do
36
38
  context 'when target branch is ommitted' do
37
39
  before do
40
+ Socialcast::Gitx::CLI.any_instance.should_receive(:post).with("#worklog integrating FOO into prototype #scgitx")
38
41
  Socialcast::Gitx::CLI.start ['integrate']
39
42
  end
43
+ it 'should post message to socialcast' do end # see expectations
40
44
  it 'should default to prototype' do
41
45
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
42
46
  "git pull origin FOO",
@@ -53,8 +57,10 @@ describe Socialcast::Gitx::CLI do
53
57
  end
54
58
  context 'when target branch == prototype' do
55
59
  before do
60
+ Socialcast::Gitx::CLI.any_instance.should_receive(:post).with("#worklog integrating FOO into prototype #scgitx")
56
61
  Socialcast::Gitx::CLI.start ['integrate', 'prototype']
57
62
  end
63
+ it 'should post message to socialcast' do end # see expectations
58
64
  it 'should run expected commands' do
59
65
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
60
66
  "git pull origin FOO",
@@ -71,8 +77,10 @@ describe Socialcast::Gitx::CLI do
71
77
  end
72
78
  context 'when target branch == staging' do
73
79
  before do
80
+ Socialcast::Gitx::CLI.any_instance.should_receive(:post).with("#worklog integrating FOO into staging #scgitx")
74
81
  Socialcast::Gitx::CLI.start ['integrate', 'staging']
75
82
  end
83
+ it 'should post message to socialcast' do end # see expectations
76
84
  it 'should also integrate into prototype and run expected commands' do
77
85
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
78
86
  "git pull origin FOO",
@@ -113,9 +121,11 @@ describe Socialcast::Gitx::CLI do
113
121
  end
114
122
  context 'when user confirms release' do
115
123
  before do
124
+ Socialcast::Gitx::CLI.any_instance.should_receive(:post).with("#worklog releasing FOO to production #scgitx")
116
125
  Socialcast::Gitx::CLI.any_instance.should_receive(:yes?).and_return(true)
117
126
  Socialcast::Gitx::CLI.start ['release']
118
127
  end
128
+ it 'should post message to socialcast' do end # see expectations
119
129
  it 'should run expected commands' do
120
130
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
121
131
  "git pull origin FOO",
@@ -127,20 +137,11 @@ describe Socialcast::Gitx::CLI do
127
137
  "git push origin HEAD",
128
138
  "git checkout FOO",
129
139
  "git checkout master",
130
- "git pull origin FOO",
131
- "git pull origin master",
132
- "git push origin HEAD",
133
140
  "git checkout staging",
134
141
  "git pull origin staging",
135
- "git pull . FOO",
136
- "git push origin HEAD",
137
- "git checkout FOO",
138
- "git checkout prototype",
139
- "git pull origin prototype",
140
- "git pull . staging",
142
+ "git pull . master",
141
143
  "git push origin HEAD",
142
- "git checkout staging",
143
- "git checkout FOO",
144
+ "git checkout master",
144
145
  "git checkout master",
145
146
  "git pull",
146
147
  "git remote prune origin"
@@ -152,8 +153,10 @@ describe Socialcast::Gitx::CLI do
152
153
  describe '#nuke' do
153
154
  context 'when target branch == prototype and --destination == master' do
154
155
  before do
156
+ Socialcast::Gitx::CLI.any_instance.should_receive(:post).with("#worklog resetting prototype branch to last_known_good_master #scgitx")
155
157
  Socialcast::Gitx::CLI.start ['nuke', 'prototype', '--destination', 'master']
156
158
  end
159
+ it 'should publish message into socialcast' do end # see expectations
157
160
  it 'should run expected commands' do
158
161
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
159
162
  "git checkout last_known_good_master",
@@ -248,9 +251,7 @@ describe Socialcast::Gitx::CLI do
248
251
 
249
252
  Socialcast::Gitx::CLI.start ['reviewrequest', '--description', 'testing']
250
253
  end
251
- it 'should create github pull request' do
252
-
253
- end
254
+ it 'should create github pull request' do end # see expectations
254
255
  it 'should run expected commands' do
255
256
  Socialcast::Gitx::CLI.stubbed_executed_commands.should == [
256
257
  "git pull origin FOO",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast-git-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-04 00:00:00.000000000 Z
12
+ date: 2012-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grit
@@ -230,7 +230,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  segments:
232
232
  - 0
233
- hash: 2981719831077906514
233
+ hash: 1096009066134982419
234
234
  required_rubygems_version: !ruby/object:Gem::Requirement
235
235
  none: false
236
236
  requirements:
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  version: '0'
240
240
  segments:
241
241
  - 0
242
- hash: 2981719831077906514
242
+ hash: 1096009066134982419
243
243
  requirements: []
244
244
  rubyforge_project: socialcast-git-extensions
245
245
  rubygems_version: 1.8.24