buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boisv...@apache.org
Subject svn commit: r836108 - in /buildr/trunk: CHANGELOG lib/buildr/core/build.rb spec/core/build_spec.rb
Date Sat, 14 Nov 2009 03:07:35 GMT
Author: boisvert
Date: Sat Nov 14 03:07:35 2009
New Revision: 836108

URL: http://svn.apache.org/viewvc?rev=836108&view=rev
Log:
BUILDR-223 Release Task: customizable commit message (Alexis Midon)

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/core/build.rb
    buildr/trunk/spec/core/build_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=836108&r1=836107&r2=836108&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sat Nov 14 03:07:35 2009
@@ -7,6 +7,7 @@
           generated .classpath using: 
             eclipse.classpath_variables { :VAR => '/path/to/libraries' }
 * Change: Updated to JRuby 1.4.0
+* Fixed:  BUILDR-223 Release Task: customizable commit message (Alexis Midon)
 * Fixed:  BUILDR-330  Install task should re-install artifact even if they 
           already exist (Alexis Midon)
 * Fixed:  BUILDR-334 Eclipse .classpath files use absolute paths for library 

Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=836108&r1=836107&r2=836108&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Sat Nov 14 03:07:35 2009
@@ -226,7 +226,19 @@
     THIS_VERSION_PATTERN  = /(THIS_VERSION|VERSION_NUMBER)\s*=\s*(["'])(.*)\2/
 
     class << self
-      
+ 
+      # 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}" }
+      attr_accessor :tag_name
+
+      # 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.commit_message = lambda { |ver| "Changed version number to #{ver}" }
+      attr_accessor :commit_message
+
       # :call-seq:
       #     add(MyReleaseClass)
       #
@@ -252,18 +264,6 @@
       end
 
     end
- 
-    # 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}" }
-    attr_accessor :tag_name
-
-    # 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.commit_message = lambda { |ver| "Changed version number to #{ver}" }
-    attr_accessor :commit_message
 
     # :call-seq:
     #   make()
@@ -342,7 +342,7 @@
     # Return the name of the tag to tag the release with.
     def resolve_tag
       version = extract_version
-      tag = tag_name || version
+      tag = Release.tag_name || version
       tag = tag.call(version) if Proc === tag
       tag
     end
@@ -356,7 +356,7 @@
     # Return the message to use to cimmit the buildfile with the next version
     def message
       version = extract_version
-      msg = commit_message || "Changed version number to #{version}"
+      msg = Release.commit_message || "Changed version number to #{version}"
       msg = msg.call(version) if Proc === msg
       msg
     end

Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=836108&r1=836107&r2=836108&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Sat Nov 14 03:07:35 2009
@@ -421,15 +421,15 @@
     end
 
     it 'should return tag specified by tag_name' do
-      @release.tag_name  = 'first'
+      Release.tag_name  = 'first'
       @release.send(:resolve_tag).should == 'first'
     end
     
     it 'should use tag returned by tag_name if tag_name is a proc' do
-      @release.tag_name  = lambda { |version| "buildr-#{version}" }
+      Release.tag_name  = lambda { |version| "buildr-#{version}" }
       @release.send(:resolve_tag).should == 'buildr-1.0.0'
     end
-    after { @release.tag_name = nil }
+    after { Release.tag_name = nil }
   end
 
   describe '#tag_release' do
@@ -501,13 +501,13 @@
     end
 
     it 'should use the commit message specified by commit_message' do
-      @release.commit_message  = 'Here is my custom message'
+      Release.commit_message  = 'Here is my custom message'
       @release.should_receive(:message).and_return('Here is my custom message')
       @release.update_version_to_next
     end
     
     it 'should use the commit message returned by commit_message if commit_message is a proc'
do
-      @release.commit_message  = lambda { |new_version| 
+      Release.commit_message  = lambda { |new_version| 
         new_version.should == '1.0.1-SNAPSHOT'
         "increment version number to #{new_version}"
       }
@@ -518,6 +518,7 @@
     it 'should inform the user of the new version' do
       lambda { @release.update_version_to_next }.should show_info('Current version is now
1.0.1-SNAPSHOT')
     end
+    after { Release.commit_message = nil }
   end
 
 end



Mime
View raw message