version 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === Version 0.7.0 / 2010-02-05
2
+
3
+ * enhancements
4
+ * support for committing and tagging through git
5
+ * see rdoc for Rake::VersionTask
6
+
1
7
  === Version 0.6.2 / 2010-02-05
2
8
 
3
9
  * bug fixes
data/Rakefile CHANGED
@@ -34,6 +34,8 @@ Spec::Rake::SpecTask.new(:spec) do |spec|
34
34
  spec.spec_files = FileList['spec/**/*_spec.rb']
35
35
  end
36
36
 
37
- Rake::VersionTask.new
37
+ Rake::VersionTask.new do |v|
38
+ v.with_git_tag = true
39
+ end
38
40
 
39
41
  task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.7.0
@@ -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
- # if self.with_git
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: version
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Touset