bumper_pusher 0.1.2 → 0.1.4

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: 1dc19e51d8748e1603926fe55f2548242cc0bbf6
4
- data.tar.gz: a046581659d88a5e35fa71e3b7527480ebf38855
3
+ metadata.gz: b2ed9473b61cd4475b712d59b4ad21f018e096e5
4
+ data.tar.gz: 8fea6ee93a718cc2b722db719d3ebaa99dd32d85
5
5
  SHA512:
6
- metadata.gz: 78e797d896aef52c5641c2f038829147acda01c69dfcdc8b4ae596f26988e4ec96d961d2e85b8e000ed84cbd10758ad2d94fe48729f2286244c33db0cd06907d
7
- data.tar.gz: ec48f9986ba0c1cc4a38a47cfe2d3092a5aeb6acc484babfd8c1c32b632d44ada9162132cc0ad4a4a844e680c010db419bc0e98d99a0f91356335323f2ebf5bc
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
- TODO: Write usage instructions here
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 )
@@ -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
@@ -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: bump.rb [options]'
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
@@ -1,3 +1,3 @@
1
1
  module BumperPusher
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumper_pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Korolev