bumper_pusher 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +20 -3
- data/lib/bumper_pusher/bumper.rb +29 -9
- data/lib/bumper_pusher/parser.rb +5 -2
- data/lib/bumper_pusher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2ed9473b61cd4475b712d59b4ad21f018e096e5
|
4
|
+
data.tar.gz: 8fea6ee93a718cc2b722db719d3ebaa99dd32d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 034e1d1090bd10bdfd92fb9f1504810df751b51d95bd8e708fc925e34c201cc2f8c0065b377ec5ddd97e45de075cd234aa8c8a0d7784c30b945fbc9604828612
|
7
|
+
data.tar.gz: 2ca25ff45f9eb4d28e1badedd2dbcae3dc36c135a4b421cc0a44561d44738f76d4b803f302e4ef4e1f035f465963cf617caebd99829b1107f1d52937017356b7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.3] (https://github.com/skywinder/bumper_pusher/tree/0.1.3)
|
4
|
+
#### 19/11/14
|
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
|
+
|
7
|
+
- *Merged pull-request:* Remove confirmation for build for beta builds [\#3](https://github.com/skywinder/bumper_pusher/pull/3) ([skywinder](https://github.com/skywinder))
|
8
|
+
|
9
|
+
## [0.1.2] (https://github.com/skywinder/bumper_pusher/tree/0.1.2)
|
10
|
+
#### 19/11/14
|
11
|
+
- *Merged pull-request:* Install and remove gem after push [\#2](https://github.com/skywinder/bumper_pusher/pull/2) ([skywinder](https://github.com/skywinder))
|
12
|
+
|
13
|
+
- *Merged pull-request:* Don't generate changelog for beta build [\#1](https://github.com/skywinder/bumper_pusher/pull/1) ([skywinder](https://github.com/skywinder))
|
14
|
+
|
3
15
|
## [0.1.1] (https://github.com/skywinder/bumper_pusher/tree/0.1.1)
|
4
16
|
#### 18/11/14
|
5
17
|
## [0.1.0] (https://github.com/skywinder/bumper_pusher/tree/0.1.0)
|
data/README.md
CHANGED
@@ -19,9 +19,26 @@ Or install it yourself as:
|
|
19
19
|
$ gem install bumper_pusher
|
20
20
|
|
21
21
|
## Usage
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
- To bump path version and push your gemspec or podscpec file: `bumper_pusher`
|
23
|
+
- `-r` for bump release
|
24
|
+
- `-m` for bump minor
|
25
|
+
- `-p` for bump patch (default option)
|
26
|
+
|
27
|
+
- To install locally your gemspec `bumper_pusher -b`
|
28
|
+
|
29
|
+
..Look at **Params** section for details.
|
30
|
+
|
31
|
+
### Params:
|
32
|
+
Usage: bumper_pusher [options]
|
33
|
+
-d, --dry-run Dry run
|
34
|
+
--release Bump release version
|
35
|
+
-m, --minor Bump minor version
|
36
|
+
-p, --patch Bump patch version
|
37
|
+
-r, --revert Revert last bump
|
38
|
+
-i, --[no-]install Install this gem after push it. Default is true.
|
39
|
+
-b, --beta Build beta gem without commit and push
|
40
|
+
-v, --version Print version number
|
41
|
+
-c, --[no]-changelog Auto generation of changelog and pushing it origin. Default is true
|
25
42
|
## Contributing
|
26
43
|
|
27
44
|
1. Fork it ( https://github.com/skywinder/bumper_pusher/fork )
|
data/lib/bumper_pusher/bumper.rb
CHANGED
@@ -31,6 +31,12 @@ module BumperPusher
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
current_branch = `git rev-parse --abbrev-ref HEAD`.strip!
|
36
|
+
if current_branch != 'master'
|
37
|
+
puts "Warning: You're not in 'master' branch (#{current_branch})!".yellow
|
38
|
+
ask_sure_Y
|
39
|
+
end
|
34
40
|
end
|
35
41
|
|
36
42
|
|
@@ -86,6 +92,9 @@ module BumperPusher
|
|
86
92
|
|
87
93
|
case arr.count
|
88
94
|
when 0
|
95
|
+
if @options[:dry_run]
|
96
|
+
return "test.#{POD_SPEC_TYPE}"
|
97
|
+
end
|
89
98
|
puts "No #{POD_SPEC_TYPE} files found. -> Exit."
|
90
99
|
exit
|
91
100
|
when 1
|
@@ -147,9 +156,23 @@ module BumperPusher
|
|
147
156
|
end
|
148
157
|
|
149
158
|
puts "Bump version: #{versions_array.join('.')} -> #{bumped_version}"
|
159
|
+
|
160
|
+
unless @options[:dry_run] || @options[:beta]
|
161
|
+
ask_sure_Y
|
162
|
+
end
|
163
|
+
|
150
164
|
bumped_version
|
151
165
|
end
|
152
166
|
|
167
|
+
def ask_sure_Y
|
168
|
+
puts 'Are you sure? Press Y to continue:'
|
169
|
+
str = gets.chomp
|
170
|
+
if str != 'Y'
|
171
|
+
puts '-> exit'
|
172
|
+
exit
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
153
176
|
def execute_line(line)
|
154
177
|
output = `#{line}`
|
155
178
|
check_exit_status(output)
|
@@ -185,15 +208,6 @@ module BumperPusher
|
|
185
208
|
result, versions_array = find_version_in_file(version_file)
|
186
209
|
bumped_version = bump_version(versions_array)
|
187
210
|
|
188
|
-
unless @options[:dry_run]
|
189
|
-
puts 'Are you sure? Press Y to continue:'
|
190
|
-
str = gets.chomp
|
191
|
-
if str != 'Y'
|
192
|
-
puts '-> exit'
|
193
|
-
exit
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
211
|
if @options[:bump]
|
198
212
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{result}/#{bumped_version}/\" README.md")
|
199
213
|
execute_line_if_not_dry_run("sed -i \"\" \"s/#{result}/#{bumped_version}/\" #{version_file}")
|
@@ -217,6 +231,12 @@ module BumperPusher
|
|
217
231
|
execute_line_if_not_dry_run("gem build #{@spec_file}")
|
218
232
|
gem = find_current_gem_file
|
219
233
|
execute_line_if_not_dry_run("gem push #{gem}")
|
234
|
+
|
235
|
+
if @options[:install]
|
236
|
+
execute_line_if_not_dry_run("gem install #{gem}")
|
237
|
+
end
|
238
|
+
|
239
|
+
execute_line_if_not_dry_run("rm #{gem}")
|
220
240
|
else
|
221
241
|
raise 'Unknown spec type'
|
222
242
|
end
|
data/lib/bumper_pusher/parser.rb
CHANGED
@@ -10,10 +10,10 @@ module BumperPusher
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def parse_options
|
13
|
-
options = {:dry_run => false, :bump_number => :patch, :changelog => true, :bump => true, :commit => true, :build => true, :push => true}
|
13
|
+
options = {:dry_run => false, :bump_number => :patch, :changelog => true, :bump => true, :commit => true, :build => true, :push => true, :install => true}
|
14
14
|
|
15
15
|
OptionParser.new { |opts|
|
16
|
-
opts.banner = 'Usage:
|
16
|
+
opts.banner = 'Usage: bumper_pusher [options]'
|
17
17
|
|
18
18
|
opts.on('-d', '--dry-run', 'Dry run') do |v|
|
19
19
|
options[:dry_run] = v
|
@@ -30,6 +30,9 @@ module BumperPusher
|
|
30
30
|
opts.on('-r', '--revert', 'Revert last bump') do |v|
|
31
31
|
options[:revert] = v
|
32
32
|
end
|
33
|
+
opts.on('-i', '--[no-]install', 'Install this gem after push it. Default is true.') do |v|
|
34
|
+
options[:install] = v
|
35
|
+
end
|
33
36
|
opts.on('-b', '--beta', 'Build beta gem without commit and push') do |v|
|
34
37
|
options[:beta] = v
|
35
38
|
options[:bump] = v
|