From f4ed5a6b459f2a5080977a18ec904a0acc0210df Mon Sep 17 00:00:00 2001 From: Jim Weirich Date: Tue, 30 Apr 2013 17:27:01 -0400 Subject: [PATCH] Add comment= back (used by rail ties). And bump to version 10.1.0.beta.3 --- lib/rake/task.rb | 4 ++++ lib/rake/version.rb | 2 +- test/test_rake_task.rb | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 9e1d3d791..5e4dd64d4 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -257,6 +257,10 @@ def add_description(description) add_comment(comment) if comment && ! comment.empty? end + def comment=(comment) + add_comment(comment) + end + def add_comment(comment) @comments << comment unless @comments.include?(comment) end diff --git a/lib/rake/version.rb b/lib/rake/version.rb index fdec986a6..2817720ff 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,5 +1,5 @@ module Rake - VERSION = '10.1.0.beta.2' + VERSION = '10.1.0.beta.3' module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 48a992c46..2ab995a6f 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -307,6 +307,12 @@ def test_investigation_output assert_match(/pre-requisites:\s*--t[23]/, out) end + # NOTE: Rail-ties uses comment=. + def test_comment_setting + t = task(:t, :name, :rev) + t.comment = "A Comment" + assert_equal "A Comment", t.comment + end def test_comments_with_sentences desc "Comment 1. Comment 2."