bumper_pusher 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/bumper_pusher/bumper.rb +52 -20
- data/lib/bumper_pusher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 221caf300713c8a338aea4067b57a8fc07b23096
|
4
|
+
data.tar.gz: e452613d46aae1f3652d1edc6a1aafaef493d2ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 434d801446803d372fc1d66c257c655f608a0b71787c68e8abf99c169190b9de1f5256446ee592db6ef3ab5e9f581367ff75bde8f0822f4c0e0d221419bcc757
|
7
|
+
data.tar.gz: 46236f555c829db0fd4263ea7897305f4245d4c73a989dbd503c458ab0d5da3b72b88278c95ccf79b9190f67de33e5b45b03942a51249a74d3cec2804142a205
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.14](https://github.com/skywinder/bumper_pusher/tree/0.1.14)
|
4
|
+
[Full Changelog](https://github.com/skywinder/bumper_pusher/compare/0.1.13...0.1.14)
|
5
|
+
#### 09/02/15
|
3
6
|
## [0.1.13](https://github.com/skywinder/bumper_pusher/tree/0.1.13)
|
4
7
|
[Full Changelog](https://github.com/skywinder/bumper_pusher/compare/0.1.12...0.1.13)
|
5
8
|
#### 09/02/15
|
data/lib/bumper_pusher/bumper.rb
CHANGED
@@ -33,13 +33,13 @@ module BumperPusher
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
current_branch = get_current_branch
|
36
|
+
current_branch = get_current_branch
|
37
37
|
|
38
38
|
unless @options[:beta]
|
39
39
|
|
40
|
-
if
|
40
|
+
if is_git_flow_installed
|
41
41
|
# supposed, that with git flow you should release from develop branch
|
42
|
-
if current_branch != 'develop'
|
42
|
+
if current_branch != 'develop' && !is_branch_hotfix?
|
43
43
|
puts "Warning: You're in branch (#{current_branch})!".yellow
|
44
44
|
ask_sure_Y
|
45
45
|
end
|
@@ -73,7 +73,12 @@ module BumperPusher
|
|
73
73
|
case all_specs.count
|
74
74
|
when 0
|
75
75
|
puts 'No spec files found. -> Exit.'
|
76
|
-
|
76
|
+
if is_debug?
|
77
|
+
puts 'Debug -> set @spec_mode to gem -> continue'
|
78
|
+
@spec_mode = GEM_SPEC_TYPE
|
79
|
+
else
|
80
|
+
exit
|
81
|
+
end
|
77
82
|
when 1
|
78
83
|
spec_file = all_specs[0]
|
79
84
|
else
|
@@ -103,6 +108,10 @@ module BumperPusher
|
|
103
108
|
|
104
109
|
end
|
105
110
|
|
111
|
+
def is_debug?
|
112
|
+
(ENV['RUBYLIB'] =~ /ruby-debug-ide/) ? true : false
|
113
|
+
end
|
114
|
+
|
106
115
|
def find_current_gem_file
|
107
116
|
list_of_specs = execute_line("find . -name '*.gem'")
|
108
117
|
arr = list_of_specs.split("\n")
|
@@ -184,11 +193,13 @@ module BumperPusher
|
|
184
193
|
end
|
185
194
|
|
186
195
|
def ask_sure_Y
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
196
|
+
unless @options[:dry_run]
|
197
|
+
puts 'Are you sure? Press Y to continue:'
|
198
|
+
str = gets.chomp
|
199
|
+
if str != 'Y'
|
200
|
+
puts '-> exit'
|
201
|
+
exit
|
202
|
+
end
|
192
203
|
end
|
193
204
|
end
|
194
205
|
|
@@ -202,7 +213,7 @@ module BumperPusher
|
|
202
213
|
def execute_line_if_not_dry_run(line, check_exit = true)
|
203
214
|
if @options[:dry_run]
|
204
215
|
puts "Dry run: #{line}"
|
205
|
-
nil
|
216
|
+
check_exit ? nil : 0
|
206
217
|
else
|
207
218
|
puts line
|
208
219
|
value = %x[#{line}]
|
@@ -263,9 +274,12 @@ module BumperPusher
|
|
263
274
|
check_repo_is_clean_or_dry_run
|
264
275
|
|
265
276
|
unless @options[:beta]
|
266
|
-
|
277
|
+
unless is_branch_hotfix?
|
278
|
+
execute_line_if_not_dry_run('git pull')
|
279
|
+
end
|
267
280
|
current_branch = get_current_branch
|
268
281
|
execute_line_if_not_dry_run("git checkout master && git pull && git checkout #{current_branch}")
|
282
|
+
execute_line_if_not_dry_run('git push --all')
|
269
283
|
end
|
270
284
|
|
271
285
|
version_file = find_version_file
|
@@ -274,10 +288,14 @@ module BumperPusher
|
|
274
288
|
|
275
289
|
|
276
290
|
unless @options[:beta]
|
277
|
-
|
291
|
+
<<<<<<< HEAD
|
278
292
|
if is_gitflow_installed
|
293
|
+
=======
|
294
|
+
execute_line_if_not_dry_run('git push --all')
|
295
|
+
if is_git_flow_installed && !is_branch_hotfix?
|
296
|
+
>>>>>>> hotfix/fix-13
|
279
297
|
execute_line_if_not_dry_run("git flow release start #{bumped_version}", check_exit = false)
|
280
|
-
|
298
|
+
end
|
281
299
|
end
|
282
300
|
|
283
301
|
if @options[:bump]
|
@@ -288,16 +306,24 @@ module BumperPusher
|
|
288
306
|
if @options[:commit]
|
289
307
|
execute_line_if_not_dry_run("git commit --all -m \"Update #{@spec_mode} to version #{bumped_version}\"")
|
290
308
|
|
291
|
-
if
|
292
|
-
|
293
|
-
|
294
|
-
execute_line_if_not_dry_run(
|
309
|
+
if is_git_flow_installed
|
310
|
+
if is_branch_hotfix?
|
311
|
+
branch_split = get_current_branch.split('/').last
|
312
|
+
if execute_line_if_not_dry_run("git flow hotfix finish -n #{branch_split}", check_exit = false) == 0
|
313
|
+
execute_line_if_not_dry_run('git checkout master')
|
314
|
+
end
|
315
|
+
else
|
316
|
+
if execute_line_if_not_dry_run("git flow release finish -n #{bumped_version}", check_exit = false) == 0
|
317
|
+
execute_line_if_not_dry_run('git checkout master')
|
318
|
+
end
|
295
319
|
end
|
296
320
|
end
|
321
|
+
execute_line_if_not_dry_run('git push --all')
|
297
322
|
execute_line_if_not_dry_run("git tag #{bumped_version}")
|
298
323
|
end
|
299
324
|
|
300
325
|
if @options[:push]
|
326
|
+
execute_line_if_not_dry_run('git push --all')
|
301
327
|
execute_line_if_not_dry_run('git push --tags')
|
302
328
|
|
303
329
|
if @spec_mode == POD_SPEC_TYPE
|
@@ -339,12 +365,12 @@ module BumperPusher
|
|
339
365
|
puts 'Cancelled bumping: no github_changelog_generator gem found'
|
340
366
|
else
|
341
367
|
|
342
|
-
if
|
368
|
+
if is_git_flow_installed
|
343
369
|
execute_line_if_not_dry_run("git flow hotfix start update-changelog", check_exit = false)
|
344
370
|
end
|
345
371
|
execute_line_if_not_dry_run('github_changelog_generator')
|
346
372
|
execute_line_if_not_dry_run("git commit CHANGELOG.md -m \"Update changelog for version #{bumped_version}\"")
|
347
|
-
if
|
373
|
+
if is_git_flow_installed
|
348
374
|
|
349
375
|
if execute_line_if_not_dry_run("git flow hotfix finish -n update-changelog", check_exit = false) == 0
|
350
376
|
current_branch = get_current_branch
|
@@ -392,9 +418,15 @@ module BumperPusher
|
|
392
418
|
execute_line_if_not_dry_run("git push --delete origin #{result}")
|
393
419
|
end
|
394
420
|
|
395
|
-
def
|
421
|
+
def is_git_flow_installed
|
396
422
|
system("git flow version") ? true : false
|
397
423
|
end
|
424
|
+
|
425
|
+
def is_branch_hotfix?
|
426
|
+
branch = get_current_branch
|
427
|
+
branch.include? 'hotfix'
|
428
|
+
end
|
429
|
+
|
398
430
|
end
|
399
431
|
|
400
432
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bumper_pusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Korolev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|