Class: Rake::VersionTask
- Inherits:
-
TaskLib
- Object
- TaskLib
- Rake::VersionTask
- Defined in:
- lib/rake/version_task.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#filetype ⇒ Object
The
filetype
of the file to be generated. -
#with_commit_message ⇒ Object
when set allows to override commit message.
-
#with_gemspec ⇒ Object
when set with a Gem::Specification, automatically emits an updated gemspec on version bumps.
-
#with_git ⇒ Object
when true, commits version bumps automatically (default: autodetect).
-
#with_git_tag ⇒ Object
when true, tags version bumps automatically (default: false).
-
#with_hg ⇒ Object
when true, commits version bumps automatically (default: autodetect).
-
#with_hg_tag ⇒ Object
when true, tags version bumps automatically (default: false).
-
#with_svn ⇒ Object
when true, commits version bumps automatically (default: autodetect).
-
#with_svn_tag ⇒ Object
when true, tags version bumps automatically if the current svn URL either ends in ‘<base>/trunk’ or ‘<base>/branches/<branch>’ by copying the current svn URL to the ‘<base>/tags/<version>’ (default: false).
Instance Method Summary collapse
- #gemspec ⇒ Object
-
#initialize(filename = 'VERSION') {|_self| ... } ⇒ VersionTask
constructor
Creates a new VersionTask with the given
filename
.
Constructor Details
#initialize(filename = 'VERSION') {|_self| ... } ⇒ VersionTask
Creates a new VersionTask with the given filename
. Attempts to autodetect the filetype
and whether or not git or hg is present.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rake/version_task.rb', line 42 def initialize(filename = 'VERSION') self.filename = filename self.with_git = File.exist?('.git') self.with_hg = File.exist?('.hg') self.with_svn = File.exist?('.svn') yield(self) if block_given? self.define end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
7 8 9 |
# File 'lib/rake/version_task.rb', line 7 def filename @filename end |
#filetype ⇒ Object
The filetype
of the file to be generated. Is determined automatically if not set.
57 58 59 |
# File 'lib/rake/version_task.rb', line 57 def filetype @filetype || self.path.extname[1..-1] end |
#with_commit_message ⇒ Object
when set allows to override commit message
36 37 38 |
# File 'lib/rake/version_task.rb', line 36 def @with_commit_message end |
#with_gemspec ⇒ Object
when set with a Gem::Specification, automatically emits an updated gemspec on version bumps
33 34 35 |
# File 'lib/rake/version_task.rb', line 33 def with_gemspec @with_gemspec end |
#with_git ⇒ Object
when true, commits version bumps automatically (default: autodetect)
11 12 13 |
# File 'lib/rake/version_task.rb', line 11 def with_git @with_git end |
#with_git_tag ⇒ Object
when true, tags version bumps automatically (default: false)
14 15 16 |
# File 'lib/rake/version_task.rb', line 14 def with_git_tag @with_git_tag end |
#with_hg ⇒ Object
when true, commits version bumps automatically (default: autodetect)
17 18 19 |
# File 'lib/rake/version_task.rb', line 17 def with_hg @with_hg end |
#with_hg_tag ⇒ Object
when true, tags version bumps automatically (default: false)
20 21 22 |
# File 'lib/rake/version_task.rb', line 20 def with_hg_tag @with_hg_tag end |
#with_svn ⇒ Object
when true, commits version bumps automatically (default: autodetect)
23 24 25 |
# File 'lib/rake/version_task.rb', line 23 def with_svn @with_svn end |
#with_svn_tag ⇒ Object
when true, tags version bumps automatically if the current svn URL either ends in ‘<base>/trunk’ or ‘<base>/branches/<branch>’ by copying the current svn URL to the ‘<base>/tags/<version>’ (default: false)
29 30 31 |
# File 'lib/rake/version_task.rb', line 29 def with_svn_tag @with_svn_tag end |
Instance Method Details
#gemspec ⇒ Object
61 62 63 |
# File 'lib/rake/version_task.rb', line 61 def gemspec Pathname("#{with_gemspec.name}.gemspec") if with_gemspec end |