bump 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/bump.gemspec +1 -1
- data/lib/bump.rb +13 -1
- data/spec/bump_spec.rb +4 -3
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/bump.gemspec
CHANGED
data/lib/bump.rb
CHANGED
@@ -54,11 +54,23 @@ module Bump
|
|
54
54
|
|
55
55
|
def self.bump(file, current, next_version, options)
|
56
56
|
replace(file, current, next_version)
|
57
|
-
|
57
|
+
if options[:bundle] and under_version_control?("Gemfile.lock")
|
58
|
+
bundler_with_clean_env do
|
59
|
+
system("bundle")
|
60
|
+
end
|
61
|
+
end
|
58
62
|
commit(next_version, file, options) if options[:commit]
|
59
63
|
["Bump version #{current} to #{next_version}", 0]
|
60
64
|
end
|
61
65
|
|
66
|
+
def self.bundler_with_clean_env(&block)
|
67
|
+
if defined?(Bundler)
|
68
|
+
Bundler.with_clean_env(&block)
|
69
|
+
else
|
70
|
+
yield
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
62
74
|
def self.bump_part(part, options)
|
63
75
|
current, file = current_info
|
64
76
|
next_version = next_version(current, part)
|
data/spec/bump_spec.rb
CHANGED
@@ -271,6 +271,7 @@ describe Bump do
|
|
271
271
|
write_gemspec('"1.0.0"')
|
272
272
|
write "Gemfile", <<-RUBY
|
273
273
|
source :rubygems
|
274
|
+
gem "parallel" # a gem not in the Gemfile used to run this test
|
274
275
|
gemspec
|
275
276
|
RUBY
|
276
277
|
`git add Gemfile #{gemspec}`
|
@@ -279,20 +280,20 @@ describe Bump do
|
|
279
280
|
|
280
281
|
it "bundle to keep version up to date and commit changed Gemfile.lock" do
|
281
282
|
`git add Gemfile.lock`
|
282
|
-
|
283
|
+
bump("patch")
|
283
284
|
read("Gemfile.lock").should include "1.0.1"
|
284
285
|
`git status`.should include "nothing to commit"
|
285
286
|
end
|
286
287
|
|
287
288
|
it "does not bundle with --no-bundle" do
|
288
|
-
|
289
|
+
bump("patch --no-bundle")
|
289
290
|
read(gemspec).should include "1.0.1"
|
290
291
|
read("Gemfile.lock").should include "1.0.0"
|
291
292
|
`git status --porcelain`.should include "?? Gemfile.lock"
|
292
293
|
end
|
293
294
|
|
294
295
|
it "does not bundle or commit an untracked Gemfile.lock" do
|
295
|
-
|
296
|
+
bump("patch")
|
296
297
|
read("Gemfile.lock").should include "1.0.0"
|
297
298
|
`git status --porcelain`.should include "?? Gemfile.lock"
|
298
299
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|