bump 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +6 -5
- data/bump.gemspec +1 -1
- data/lib/bump.rb +7 -0
- data/spec/bump_spec.rb +14 -0
- metadata +1 -1
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Introduction
|
2
|
-
Bump is a gem that will simplify the way you build gems.
|
2
|
+
Bump is a gem that will simplify the way you build gems and chef-cookbooks.
|
3
3
|
|
4
4
|
|
5
5
|
# Installation
|
@@ -8,13 +8,13 @@ Bump is a gem that will simplify the way you build gems.
|
|
8
8
|
|
9
9
|
# Usage
|
10
10
|
|
11
|
-
Current version
|
11
|
+
Current version:
|
12
12
|
|
13
13
|
bump current
|
14
14
|
|
15
15
|
Current version: 0.1.2
|
16
16
|
|
17
|
-
Bump
|
17
|
+
Bump (major, minor, patch, pre):
|
18
18
|
|
19
19
|
bump patch
|
20
20
|
|
@@ -23,13 +23,13 @@ Bump version 0.1.2 to 0.1.3
|
|
23
23
|
### Options
|
24
24
|
|
25
25
|
### --no-commit
|
26
|
-
If you don't want to make a commit after bumping
|
26
|
+
If you don't want to make a commit after bumping, add the `--no-commit` option.
|
27
27
|
|
28
28
|
bump patch --no-commit
|
29
29
|
|
30
30
|
|
31
31
|
### --no-bundle
|
32
|
-
If you don't want to run the `bundle` command after bumping
|
32
|
+
If you don't want to run the `bundle` command after bumping, add the `--no-bundle` option.
|
33
33
|
|
34
34
|
bump patch --no-bundle
|
35
35
|
|
@@ -54,6 +54,7 @@ Bump::Bump.current # -> "1.2.3"
|
|
54
54
|
- VERSION file with "1.2.3"
|
55
55
|
- gemspec with `gem.version = "1.2.3"` or `Gem:Specification.new "gem-name", "1.2.3" do`
|
56
56
|
- lib/**/version.rb file with `VERSION = "1.2.3"`
|
57
|
+
- metadata.rb with `version "1.2.3"`
|
57
58
|
|
58
59
|
# Todo
|
59
60
|
|
data/bump.gemspec
CHANGED
data/lib/bump.rb
CHANGED
@@ -72,6 +72,7 @@ module Bump
|
|
72
72
|
version_from_gemspec ||
|
73
73
|
version_from_version ||
|
74
74
|
version_from_lib_rb ||
|
75
|
+
version_from_chef ||
|
75
76
|
raise(UnfoundVersionFileError)
|
76
77
|
)
|
77
78
|
raise UnfoundVersionError unless version
|
@@ -101,6 +102,12 @@ module Bump
|
|
101
102
|
extract_version_from_file(file)
|
102
103
|
end
|
103
104
|
|
105
|
+
def self.version_from_chef
|
106
|
+
file = find_version_file("metadata.rb")
|
107
|
+
return unless file && File.read(file) =~ /^version\s+(['"])(#{VERSION_REGEX})['"]/
|
108
|
+
[$2, file]
|
109
|
+
end
|
110
|
+
|
104
111
|
def self.extract_version_from_file(file)
|
105
112
|
return unless version = File.read(file)[VERSION_REGEX]
|
106
113
|
[version, file]
|
data/spec/bump_spec.rb
CHANGED
@@ -320,6 +320,20 @@ describe Bump do
|
|
320
320
|
end
|
321
321
|
end
|
322
322
|
|
323
|
+
context "version in metadata.rb" do
|
324
|
+
let(:version) { "1.2.3" }
|
325
|
+
let(:version_file) { "metadata.rb" }
|
326
|
+
|
327
|
+
before do
|
328
|
+
write version_file, "foo :bar\nversion '#{version}'\nbar :baz\n"
|
329
|
+
end
|
330
|
+
|
331
|
+
it "should bump version" do
|
332
|
+
bump("minor").should include("1.3.0")
|
333
|
+
read(version_file).should include("1.3.0")
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
323
337
|
private
|
324
338
|
|
325
339
|
def bump(command="", options={})
|