version 0.6.2 → 0.7.0
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/History.rdoc +6 -0
- data/Rakefile +3 -1
- data/VERSION +1 -1
- data/lib/rake/version_task.rb +11 -4
- metadata +1 -1
data/History.rdoc
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.7.0
|
data/lib/rake/version_task.rb
CHANGED
|
@@ -4,18 +4,21 @@ require 'pathname'
|
|
|
4
4
|
class Rake::VersionTask < Rake::TaskLib
|
|
5
5
|
attr_accessor :filename
|
|
6
6
|
attr_writer :filetype
|
|
7
|
+
|
|
8
|
+
# when true, commits version bumps automatically (default: autodetect)
|
|
7
9
|
attr_accessor :with_git
|
|
8
10
|
|
|
11
|
+
# when true, tags version bumps automatically (default: false)
|
|
12
|
+
attr_accessor :with_git_tag
|
|
13
|
+
|
|
9
14
|
#
|
|
10
15
|
# Creates a new VersionTask with the given +filename+. Attempts to
|
|
11
|
-
# autodetect the +filetype
|
|
16
|
+
# autodetect the +filetype+ and whether or not git is present.
|
|
12
17
|
#
|
|
13
18
|
def initialize(filename = 'VERSION')
|
|
14
19
|
self.filename = filename
|
|
15
20
|
self.with_git = File.exist?('.git')
|
|
16
21
|
|
|
17
|
-
# raise self.with_git.to_s
|
|
18
|
-
|
|
19
22
|
yield(self) if block_given?
|
|
20
23
|
|
|
21
24
|
self.define
|
|
@@ -97,7 +100,11 @@ class Rake::VersionTask < Rake::TaskLib
|
|
|
97
100
|
end
|
|
98
101
|
end
|
|
99
102
|
|
|
100
|
-
|
|
103
|
+
if self.with_git
|
|
104
|
+
`git add #{self.filename}`
|
|
105
|
+
`git commit -m "Version bump to #{version}"`
|
|
106
|
+
`git tag #{version}` if self.with_git_tag
|
|
107
|
+
end
|
|
101
108
|
|
|
102
109
|
version
|
|
103
110
|
end
|