bumper_pusher 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/README.md +31 -22
- data/bumper_pusher.gemspec +2 -2
- data/lib/bumper_pusher/bumper.rb +75 -7
- data/lib/bumper_pusher/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c347d01e39fac9f0a695a8c51d5002cd19a7c782
|
4
|
+
data.tar.gz: dc287b2ff9f1f167d6c76476dabd2fbd9cae4b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6e5a4d52ae7ef99a685ba1b4255b862f00887079141abf8c376dc353fef6a0ac9d5a23a4b3efb4b7e8990c9d2fbfe6a7ceba013f6268f00fe13f6ea88b8a0b
|
7
|
+
data.tar.gz: ec4723b7ded1f2c7a700408125867bbf7ac4bb9da99702423b566345bbb795f3d70c972a2676f20094f2c2b2642628c73b7c07208c42024b2ae6f604824dd6b0
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [0.1.
|
3
|
+
## [0.1.4] (https://github.com/skywinder/bumper_pusher/tree/0.1.4)
|
4
4
|
#### 19/11/14
|
5
5
|
- *Merged pull-request:* Add check and warrning message, if you try to bump not from master branch [\#4](https://github.com/skywinder/bumper_pusher/pull/4) ([skywinder](https://github.com/skywinder))
|
6
6
|
|
data/README.md
CHANGED
@@ -1,34 +1,26 @@
|
|
1
1
|
# BumperPusher
|
2
2
|
|
3
|
-
|
3
|
+
This gem make bumping and pushing your ruby gems easy and fast!
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'bumper_pusher'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
5
|
+
- Works with `gemspec` and `podspec` files
|
6
|
+
- Automatically detect your current version (from `spec` or `version.rb` file)
|
7
|
+
- Auto-bump spec
|
8
|
+
- Auto-push spec
|
18
9
|
|
19
|
-
|
10
|
+
## Installation
|
11
|
+
[sudo] gem install bumper_pusher
|
20
12
|
|
21
13
|
## Usage
|
22
|
-
-
|
23
|
-
|
24
|
-
|
25
|
-
-
|
14
|
+
- Just print: `bumper_pusher` and that's it!
|
15
|
+
- If you want to test, that all works as expected: try **dry_run** mode: `bumper_pusher --dry-run`
|
16
|
+
- To bump version print: `bumper_pusher [option]`
|
17
|
+
- `-r` for bump release (`1.2.3` -> `2.0.0`)
|
18
|
+
- `-m` for bump minor (`1.2.3` -> `1.3.0`)
|
19
|
+
- `-p` for bump patch (`1.2.3` -> `1.2.4`) **default option**
|
26
20
|
|
27
21
|
- To install locally your gemspec `bumper_pusher -b`
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
### Params:
|
23
|
+
### Params
|
32
24
|
Usage: bumper_pusher [options]
|
33
25
|
-d, --dry-run Dry run
|
34
26
|
--release Bump release version
|
@@ -39,6 +31,23 @@ Or install it yourself as:
|
|
39
31
|
-b, --beta Build beta gem without commit and push
|
40
32
|
-v, --version Print version number
|
41
33
|
-c, --[no]-changelog Auto generation of changelog and pushing it origin. Default is true
|
34
|
+
|
35
|
+
## Alternatives
|
36
|
+
- https://github.com/peritus/bumpversion
|
37
|
+
- https://github.com/vojtajina/grunt-bump
|
38
|
+
- https://github.com/gregorym/bump
|
39
|
+
- https://github.com/svenfuchs/gem-release
|
40
|
+
|
41
|
+
## Features & Benefits of this project
|
42
|
+
|
43
|
+
- **Very easy to use**: just print `bumper_pusher` in your repo folder.
|
44
|
+
- Support version storage directly in `gemspec` file and in `version.rb`
|
45
|
+
- Check that you're bumping from `master`. (otherwise print warning with confirmation)
|
46
|
+
- Check that your `git status` in clean
|
47
|
+
- Ability to build test gem easily `bumper_pusher -b`
|
48
|
+
- Ability to generate changelog for new version by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)
|
49
|
+
- Support both `gemspec` and `podspec` files
|
50
|
+
|
42
51
|
## Contributing
|
43
52
|
|
44
53
|
1. Fork it ( https://github.com/skywinder/bumper_pusher/fork )
|
data/bumper_pusher.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ["Petr Korolev"]
|
11
11
|
spec.email = ["sky4winder@gmail.com"]
|
12
12
|
spec.summary = %q{Easiest way to bump your specs}
|
13
|
-
spec.description = %q{
|
14
|
-
spec.homepage =
|
13
|
+
spec.description = %q{Bumping and pushing your ruby gems easy and fast!}
|
14
|
+
spec.homepage = %q{https://github.com/skywinder/bumper_pusher}
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/bumper_pusher/bumper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'colorize'
|
2
|
-
|
2
|
+
require "readline"
|
3
|
+
require 'open3'
|
3
4
|
module BumperPusher
|
4
5
|
|
5
6
|
POD_SPEC_TYPE = 'podspec'
|
@@ -33,9 +34,23 @@ module BumperPusher
|
|
33
34
|
end
|
34
35
|
|
35
36
|
current_branch = `git rev-parse --abbrev-ref HEAD`.strip!
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
|
38
|
+
unless @options[:beta]
|
39
|
+
|
40
|
+
if is_gitflow_installed
|
41
|
+
# supposed, that with git flow you should release from develop branch
|
42
|
+
if current_branch != 'develop'
|
43
|
+
puts "Warning: You're in branch (#{current_branch})!".yellow
|
44
|
+
ask_sure_Y
|
45
|
+
end
|
46
|
+
else
|
47
|
+
# supposed, that w/o git flow you should release from master or release branch
|
48
|
+
if current_branch != 'master' || !/release/.match(current_branch)[0].nil?
|
49
|
+
puts "Warning: You're in branch (#{current_branch})!".yellow
|
50
|
+
ask_sure_Y
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
39
54
|
end
|
40
55
|
end
|
41
56
|
|
@@ -193,6 +208,41 @@ module BumperPusher
|
|
193
208
|
end
|
194
209
|
end
|
195
210
|
|
211
|
+
def execute_interactive_if_not_dry_run(cmd)
|
212
|
+
if @options[:dry_run]
|
213
|
+
puts "Dry run: #{cmd}"
|
214
|
+
nil
|
215
|
+
else
|
216
|
+
Open3.popen3(cmd) do |i, o, e, th|
|
217
|
+
Thread.new {
|
218
|
+
until i.closed? do
|
219
|
+
input =Readline.readline("", true).strip
|
220
|
+
i.puts input
|
221
|
+
end
|
222
|
+
}
|
223
|
+
|
224
|
+
t_err = Thread.new {
|
225
|
+
until e.eof? do
|
226
|
+
putc e.readchar
|
227
|
+
end
|
228
|
+
}
|
229
|
+
|
230
|
+
t_out = Thread.new {
|
231
|
+
until o.eof? do
|
232
|
+
putc o.readchar
|
233
|
+
end
|
234
|
+
}
|
235
|
+
|
236
|
+
Process::waitpid(th.pid) rescue nil
|
237
|
+
# "rescue nil" is there in case process already ended.
|
238
|
+
|
239
|
+
t_err.join
|
240
|
+
t_out.join
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
|
196
246
|
def check_exit_status(output)
|
197
247
|
if $?.exitstatus != 0
|
198
248
|
puts "Output:\n#{output}\nExit status = #{$?.exitstatus} ->Terminate script."
|
@@ -208,6 +258,10 @@ module BumperPusher
|
|
208
258
|
result, versions_array = find_version_in_file(version_file)
|
209
259
|
bumped_version = bump_version(versions_array)
|
210
260
|
|
261
|
+
if is_gitflow_installed && !@options[:beta]
|
262
|
+
execute_line_if_not_dry_run("git flow release start #{bumped_version}")
|
263
|
+
end
|
264
|
+
|
211
265
|
if @options[:bump]
|
212
266
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{result}/#{bumped_version}/\" README.md")
|
213
267
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{result}/#{bumped_version}/\" #{version_file}")
|
@@ -215,15 +269,19 @@ module BumperPusher
|
|
215
269
|
|
216
270
|
if @options[:commit]
|
217
271
|
execute_line_if_not_dry_run("git commit --all -m \"Update #{@spec_mode} to version #{bumped_version}\"")
|
272
|
+
|
273
|
+
if is_gitflow_installed
|
274
|
+
execute_line_if_not_dry_run("git flow release finish -n #{bumped_version}")
|
275
|
+
end
|
276
|
+
|
218
277
|
execute_line_if_not_dry_run("git tag #{bumped_version}")
|
278
|
+
|
219
279
|
end
|
220
280
|
|
221
281
|
if @options[:push]
|
222
282
|
execute_line_if_not_dry_run('git push')
|
223
283
|
execute_line_if_not_dry_run('git push --tags')
|
224
|
-
end
|
225
284
|
|
226
|
-
if @options[:push]
|
227
285
|
if @spec_mode == POD_SPEC_TYPE
|
228
286
|
execute_line_if_not_dry_run("pod trunk push #{@spec_file}")
|
229
287
|
else
|
@@ -247,7 +305,7 @@ module BumperPusher
|
|
247
305
|
if @spec_mode == GEM_SPEC_TYPE
|
248
306
|
execute_line_if_not_dry_run("gem build #{@spec_file}")
|
249
307
|
gem = find_current_gem_file
|
250
|
-
|
308
|
+
execute_interactive_if_not_dry_run("gem install #{gem}")
|
251
309
|
|
252
310
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{bumped_version}/#{result}/\" README.md")
|
253
311
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{bumped_version}/#{result}/\" #{version_file}")
|
@@ -299,5 +357,15 @@ module BumperPusher
|
|
299
357
|
execute_line_if_not_dry_run('git reset --hard HEAD~1')
|
300
358
|
execute_line_if_not_dry_run("git push --delete origin #{result}")
|
301
359
|
end
|
360
|
+
|
361
|
+
def is_gitflow_installed()
|
362
|
+
system("git flow version")? true : false
|
363
|
+
end
|
302
364
|
end
|
365
|
+
|
366
|
+
end
|
367
|
+
|
368
|
+
if $0 == __FILE__
|
369
|
+
puts "bumper.rb self run"
|
370
|
+
BumperPusher::Bumper.new({}).execute_interactive_if_not_dry_run("pwd")
|
303
371
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Korolev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.7'
|
55
|
-
description:
|
55
|
+
description: Bumping and pushing your ruby gems easy and fast!
|
56
56
|
email:
|
57
57
|
- sky4winder@gmail.com
|
58
58
|
executables:
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- lib/bumper_pusher/bumper.rb
|
73
73
|
- lib/bumper_pusher/parser.rb
|
74
74
|
- lib/bumper_pusher/version.rb
|
75
|
-
homepage:
|
75
|
+
homepage: https://github.com/skywinder/bumper_pusher
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.4.
|
95
|
+
rubygems_version: 2.4.4
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Easiest way to bump your specs
|