Class: Buildr::Release
Overview
:nodoc:
Direct Known Subclasses
Constant Summary collapse
- THIS_VERSION_PATTERN =
/(THIS_VERSION|VERSION_NUMBER)\s*=\s*(["'])(.*)\2/
Class Attribute Summary collapse
-
.commit_message ⇒ Object
Use this to specify a different commit message to commit the buildfile with the next version in source control.
-
.tag_name ⇒ Object
Use this to specify a different tag name for tagging the release in source control.
Class Method Summary collapse
-
.add(release) ⇒ Object
(also: <<)
:call-seq: add(MyReleaseClass).
-
.find ⇒ Object
Finds and returns the Release instance for this project.
-
.list ⇒ Object
The list of supported Release implementations.
Instance Method Summary collapse
-
#extract_version ⇒ Object
:call-seq: extract_version() => this_versin.
-
#make ⇒ Object
:call-seq: make().
-
#tag_name(tag_proc) ⇒ Object
Use this to specify a different tag name for tagging the release in source control.
Class Attribute Details
.commit_message ⇒ Object
Use this to specify a different commit message to commit the buildfile with the next version in source control. You can set the commit message or a proc that will be called with the next version number, for example:
Release. = lambda { |ver| "Changed version number to #{ver}" }
240 241 242 |
# File 'lib/buildr/core/build.rb', line 240 def @commit_message end |
.tag_name ⇒ Object
Use this to specify a different tag name for tagging the release in source control. You can set the tag name or a proc that will be called with the version number, for example:
Release.tag_name = lambda { |ver| "foo-#{ver}" }
234 235 236 |
# File 'lib/buildr/core/build.rb', line 234 def tag_name @tag_name end |
Class Method Details
.add(release) ⇒ Object Also known as: <<
:call-seq:
add(MyReleaseClass)
Add a Release implementation to the list of available Release classes.
246 247 248 249 |
# File 'lib/buildr/core/build.rb', line 246 def add(release) @list ||= [] @list |= [release] end |
.find ⇒ Object
Finds and returns the Release instance for this project.
258 259 260 261 262 263 264 |
# File 'lib/buildr/core/build.rb', line 258 def find unless @release klass = list.detect { |impl| impl.applies_to? } @release = klass.new if klass end @release end |
.list ⇒ Object
The list of supported Release implementations
253 254 255 |
# File 'lib/buildr/core/build.rb', line 253 def list @list ||= [] end |
Instance Method Details
#extract_version ⇒ Object
:call-seq:
extract_version() => this_versin
Extract the current version number from the buildfile. Raise an error if not found.
289 290 291 292 293 294 |
# File 'lib/buildr/core/build.rb', line 289 def extract_version buildfile = File.read(Buildr.application.buildfile.to_s) buildfile.scan(THIS_VERSION_PATTERN)[0][2] rescue fail 'Looking for THIS_VERSION = "..." in your Buildfile, none found' end |
#make ⇒ Object
:call-seq:
make()
Make a release.
272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/buildr/core/build.rb', line 272 def make check with_release_candidate_version do |release_candidate_buildfile| args = '-S', 'buildr', "_#{Buildr::VERSION}_", '--buildfile', release_candidate_buildfile args << '--environment' << Buildr.environment unless Buildr.environment.to_s.empty? args << 'clean' << 'upload' << 'DEBUG=no' ruby *args end tag_release resolve_tag update_version_to_next end |