bumper_pusher 0.0.2 → 0.1.1

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: 19f26e4c08b54f7d96ef3e353f30c9df23cc4510
4
- data.tar.gz: da73e8626640fae0fb38d221a1bbcaaefee72738
3
+ metadata.gz: d5a03338bd04427e1d6808132eec3f7e91ac1b5d
4
+ data.tar.gz: a5b9f8c0588f5668709f553e0a8091d216422a77
5
5
  SHA512:
6
- metadata.gz: adbc5354ee9482abadb418fd6907f37902132ab59f7ce21f87da2bf302c23320adb7444088bc6d23af183580c38fc40a0a3a7e1d71262403dfb747149eb844f1
7
- data.tar.gz: c9ce5b25308a9ed173907e246a99cfeb48e08ed4da16fb03c2e067a31dac7b1a9226755e9b560a8e69dcfeff8af3d7e21593f0d233d5b0e86fdb0f77f3bf5763
6
+ metadata.gz: d35be1b0835e975e2c32d8b20f45c179c9428377890be31ca0a3ba8dc4b7b22c226c809283b7513fd13825536ddcff333d0ce8482b48f9330b0f902f3c1458af
7
+ data.tar.gz: 8a057e4585e3647a5eb76a24bc86b8a8a6648ae3a4a76fa57518acf3d5bde2265751178af8f66f89123801cffdfb49ff42e98770aaf4c32fe46bd6414ea137bd
@@ -21,5 +21,6 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
+
24
25
  spec.add_runtime_dependency(%q<colorize>, ["~> 0.7"])
25
26
  end
@@ -23,8 +23,12 @@ module BumperPusher
23
23
  if @options[:dry_run]
24
24
  puts 'Repo not clean, "Dry run" enabled -> continue'
25
25
  else
26
- puts 'Repository not clean -> exit'
27
- exit
26
+ if @options[:beta]
27
+ puts 'Repo not clean, "Beta build" enabled -> continue'
28
+ else
29
+ puts 'Repository not clean -> exit'
30
+ exit
31
+ end
28
32
  end
29
33
  end
30
34
  end
@@ -123,25 +127,25 @@ module BumperPusher
123
127
  bumped_result = versions_array.dup
124
128
  bumped_result.map! { |x| x.to_i }
125
129
 
126
- case @options[:bump_number]
127
- when :major
128
- bumped_result[0] += 1
129
- bumped_result[1] = 0
130
- bumped_result[2] = 0
131
- when :minor
132
- bumped_result[1] += 1
133
- bumped_result[2] = 0
134
- when :patch
135
- bumped_result[2] += 1
136
- else
137
- raise('unknown bump_number')
138
- end
139
-
140
-
141
- bumped_version = bumped_result.join('.')
142
130
  if @options[:beta]
143
- bumped_version += 'b'
131
+ bumped_version = versions_array.join('.') + '.1'
132
+ else
133
+ case @options[:bump_number]
134
+ when :major
135
+ bumped_result[0] += 1
136
+ bumped_result[1] = 0
137
+ bumped_result[2] = 0
138
+ when :minor
139
+ bumped_result[1] += 1
140
+ bumped_result[2] = 0
141
+ when :patch
142
+ bumped_result[2] += 1
143
+ else
144
+ raise('unknown bump_number')
145
+ end
146
+ bumped_version = bumped_result.join('.')
144
147
  end
148
+
145
149
  puts "Bump version: #{versions_array.join('.')} -> #{bumped_version}"
146
150
  bumped_version
147
151
  end
@@ -224,8 +228,10 @@ module BumperPusher
224
228
  execute_line_if_not_dry_run("gem build #{@spec_file}")
225
229
  gem = find_current_gem_file
226
230
  execute_line_if_not_dry_run("gem install #{gem}")
227
- execute_line_if_not_dry_run("git checkout #{version_file}")
228
- execute_line_if_not_dry_run('git checkout README.md')
231
+
232
+ execute_line_if_not_dry_run("sed -i \"\" \"s/#{bumped_version}/#{result}/\" README.md")
233
+ execute_line_if_not_dry_run("sed -i \"\" \"s/#{bumped_version}/#{result}/\" #{version_file}")
234
+ execute_line_if_not_dry_run("rm #{gem}")
229
235
  else
230
236
  raise 'Unknown spec type'
231
237
  end
@@ -233,9 +239,14 @@ module BumperPusher
233
239
 
234
240
 
235
241
  if @options[:changelog]
236
- execute_line_if_not_dry_run("github_changelog_generator")
237
- execute_line_if_not_dry_run("git commit CHANGELOG.md -m \"Update changelog for version #{bumped_version}\"")
238
- execute_line_if_not_dry_run('git push')
242
+ if `which github_changelog_generator`.empty?
243
+ puts 'Cancelled bumping: no github_changelog_generator gem found'
244
+ else
245
+ execute_line_if_not_dry_run('github_changelog_generator')
246
+ execute_line_if_not_dry_run("git commit CHANGELOG.md -m \"Update changelog for version #{bumped_version}\"")
247
+ execute_line_if_not_dry_run('git push')
248
+ end
249
+
239
250
  end
240
251
 
241
252
  end
@@ -1,3 +1,3 @@
1
1
  module BumperPusher
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/bumper_pusher.rb CHANGED
@@ -29,5 +29,4 @@ end
29
29
  if $0 == __FILE__
30
30
  bumper = BumperPusher::Pusher.new
31
31
 
32
-
33
32
  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.0.2
4
+ version: 0.1.1
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-14 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler