bump 0.3.4 → 0.3.5
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.
- data/Gemfile.lock +1 -1
- data/README.md +9 -2
- data/bump.gemspec +1 -1
- data/lib/bump.rb +7 -7
- data/spec/bump_spec.rb +7 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,16 +26,23 @@ require "bump/tasks"
|
|
26
26
|
rake bump:patch
|
27
27
|
rake bump:current
|
28
28
|
|
29
|
+
### Ruby
|
30
|
+
```Ruby
|
31
|
+
require "bump"
|
32
|
+
Bump::Bump.run("patch") # -> version changed
|
33
|
+
Bump::Bump.current # -> "1.2.3"
|
34
|
+
```
|
35
|
+
|
29
36
|
# Supported locations
|
30
37
|
- VERSION file with "1.2.3"
|
31
|
-
- gemspec with `gem.version = "1.2.3"`
|
38
|
+
- gemspec with `gem.version = "1.2.3"` or `Gem:Specification.new "gem-name", "1.2.3" do`
|
32
39
|
- lib/**/version.rb file with `VERSION = "1.2.3"`
|
33
40
|
|
34
41
|
# Todo
|
35
42
|
|
36
43
|
- Handle options properly
|
37
44
|
- `VERSION = "1.2.3"` in lib/*.rb
|
38
|
-
-
|
45
|
+
- Build new gem version: gem build xxx.gemspec
|
39
46
|
|
40
47
|
# Author
|
41
48
|
Gregory<br/>
|
data/bump.gemspec
CHANGED
data/lib/bump.rb
CHANGED
@@ -24,7 +24,7 @@ module Bump
|
|
24
24
|
when *BUMPS
|
25
25
|
bump(bump, options)
|
26
26
|
when "current"
|
27
|
-
current
|
27
|
+
["Current version: #{current}", 0]
|
28
28
|
else
|
29
29
|
raise InvalidOptionError
|
30
30
|
end
|
@@ -40,10 +40,14 @@ module Bump
|
|
40
40
|
["Something wrong happened: #{e.message}\n#{e.backtrace.join("\n")}", 1]
|
41
41
|
end
|
42
42
|
|
43
|
+
def self.current
|
44
|
+
current_info.first
|
45
|
+
end
|
46
|
+
|
43
47
|
private
|
44
48
|
|
45
49
|
def self.bump(part, options)
|
46
|
-
current, file =
|
50
|
+
current, file = current_info
|
47
51
|
next_version = next_version(current, part)
|
48
52
|
replace(file, current, next_version)
|
49
53
|
system("bundle") if options[:bundle] and under_version_control?("Gemfile.lock")
|
@@ -62,11 +66,7 @@ module Bump
|
|
62
66
|
File.open(file, "w"){|f| f.write(content.gsub(old, new)) }
|
63
67
|
end
|
64
68
|
|
65
|
-
def self.
|
66
|
-
["Current version: #{current_version.first}", 0]
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.current_version
|
69
|
+
def self.current_info
|
70
70
|
version, file = (
|
71
71
|
version_from_version_rb ||
|
72
72
|
version_from_gemspec ||
|
data/spec/bump_spec.rb
CHANGED
@@ -118,7 +118,6 @@ describe Bump do
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
|
122
121
|
context "VERSION in version.rb" do
|
123
122
|
before do
|
124
123
|
write_version_rb
|
@@ -266,6 +265,13 @@ describe Bump do
|
|
266
265
|
end
|
267
266
|
end
|
268
267
|
|
268
|
+
context ".current" do
|
269
|
+
it "returns the version as a string" do
|
270
|
+
write_gemspec
|
271
|
+
Bump::Bump.current.should == "4.2.3"
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
269
275
|
private
|
270
276
|
|
271
277
|
def bump(command="", options={})
|
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.3.
|
4
|
+
version: 0.3.5
|
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: 2012-10-
|
12
|
+
date: 2012-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: g.marcilhacy@gmail.com
|