Browse files

fixed FistList order test bug. Mac extended attrs in tar. Missing subdir

git-svn-id: svn+ssh:// 5af023f1-ac1a-0410-98d6-829a145c37ef
  • Loading branch information...
jimweirich committed Jan 28, 2008
1 parent 663f1a1 commit 0c3268ab074003c7483617bba07153b369e875b6
Showing with 141 additions and 6 deletions.
  1. +9 −1 CHANGES
  2. +4 −0 Rakefile
  3. +114 −0 doc/release_notes/rake-0.8.0.rdoc
  4. +4 −3 lib/rake.rb
  5. +10 −2 test/test_filelist.rb
@@ -1,5 +1,14 @@
= Rake Changelog
+== Pre-Version 0.8.2
+* Fixed bug in package task so that it will include the subdir
+ directory in the package for testing.
+* Added ENV var to rakefile to prevent OS X from including extended
+ attribute junk in a tar file.
+* Fixed filename dependency order bug in test_inspect_pending and
+ test_to_s_pending.
== Version 0.8.1
* Removed requires on parsedate.rb (in Ftptools)
@@ -9,7 +18,6 @@
* Added task parameters (e.g. "rake build[version7]")
* Made task parameters passable to prerequisites.
-* The 'desc' command will now document task argument names.
* Comments are limited to 80 columns or so (suggested by Jamis Buck).
* Added -D to display full comments (suggested by Jamis Buck).
* The rake program will set the status value used in any explicit
@@ -25,6 +25,9 @@ CLOBBER.include('test/data/file_creation_task/src')
CLOBBER.include('coverage', 'rcov_aggregate')
+# Prevent OS X from including extended attribute junk in the tar output
def announce(msg='')
STDERR.puts msg
@@ -148,6 +151,7 @@ PKG_FILES = FileList[
+ 'test/**/subdir',
@@ -0,0 +1,114 @@
+= Rake 0.8.0/0.8.1 Released
+Rake version 0.8.0 is a new release of rake that includes serveral new
+== Changes
+=== New Features in Version 0.8.0
+* Tasks can now receive command line parameters. See the examples
+ below for more details.
+* Comments are limited to 80 columns on output, but full comments can
+ be seen by using the -D parameter. (feature suggested by Jamis
+ Buck).
+* Explicit exit(n) calls will now set the exit status to n. (patch
+ provided by Stephen Touset).
+* Rake is now compatible with Ruby 1.9.
+Version 0.8.1 is a minor update that includes additional Ruby 1.9
+compatibility fixes.
+== What is Rake
+Rake is a build tool similar to the make program in many ways. But
+instead of cryptic make recipes, Rake uses standard Ruby code to
+declare tasks and dependencies. You have the full power of a modern
+scripting language built right into your build tool.
+== Availability
+The easiest way to get and install rake is via RubyGems ...
+ gem install rake (you may need root/admin privileges)
+Otherwise, you can get it from the more traditional places:
+Home Page::
+== Task Argument Examples
+Prior to version 0.8.0, rake was only able to handle command line
+arguments of the form NAME=VALUE that were passed into Rake via the
+ENV hash. Many folks had asked for some kind of simple command line
+arguments, perhaps using "--" to separate regular task names from
+argument values on the command line. The problem is that there was no
+easy way to associate positional arguments on the command line with
+different tasks. Suppose both tasks :a and :b expect a command line
+argument: does the first value go with :a? What if :b is run first?
+Should it then get the first command line argument.
+Rake 0.8.0 solves this problem by explicitly passing values directly
+to the tasks that need them. For example, if I had a release task
+that required a version number, I could say:
+ rake release[0.8.0]
+And the string "0.8.0" will be passed to the :release task. Multiple
+arguments can be passed by separating them with a comma, for example:
+ rake name[john,doe]
+Just a few words of caution. The rake task name and its arguments
+need to be a single command line argument to rake. This generally
+means no spaces. If spaces are needed, then the entire rake +
+argument string should be quoted. Something like this:
+ rake "name[billy bob, smith]"
+(Quoting rules vary between operating systems and shells, so make sure
+you consult the proper docs for your OS/shell).
+=== Tasks that Expect Parameters
+Parameters are only given to tasks that are setup to expect them. In
+order to handle named parameters, the task declaration syntax for
+tasks has been extended slightly.
+For example, a task that needs a first name and last name might be
+declared as:
+ task :name, :first_name, :last_name
+The first argument is still the name of the task (:name in this case).
+The next to argumements are the names of the parameters expected by
+:name (:first_name and :last_name in the example).
+To access the values of the paramters, the block defining the task
+behaviour can now accept a second parameter:
+ task :name, :first_name, :last_name do |t, args|
+ puts "First name is #{args.first_name}"
+ puts "Last name is #{args.last_name}"
+ end
+The first argument of the block "t" is always bound to the current
+task object. The second argument "args" is an open-struct like object
+that allows access to the task arguments. Extra command line
+arguments to a task are ignored. Missing command line arguments are
+given the nil value.
+== Thanks
+As usual, it was input from users that drove a alot of these changes. The
+following people either contributed patches, made suggestions or made
+otherwise helpful comments. Thanks to ...
+* Jamis Buck (for comment formatting suggestions)
+* Stephen Touset (for exit status patch).
+-- Jim Weirich
@@ -529,7 +529,8 @@ def format_trace_flags
private :format_trace_flags
# Execute the actions associated with this task.
- def execute(args)
+ def execute(args=nil)
+ args ||= EMPTY_TASK_ARGS
if application.options.dryrun
puts "** Execute (dry run) #{name}"
@@ -772,8 +773,8 @@ def task(*args, &block)
# end
# end
-def file(args, &block)
- Rake::FileTask.define_task(args, &block)
+def file(*args, &block)
+ Rake::FileTask.define_task(*args, &block)
# Declare a file creation task.
@@ -204,12 +204,20 @@ def test_to_array
def test_to_s_pending
fl = FileList['testdata/abc.*']
- assert_equal %{testdata/abc.c testdata/abc.h testdata/abc.x}, fl.to_s
+ result = fl.to_s
+ assert_match(%r{testdata/abc\.c}, result)
+ assert_match(%r{testdata/abc\.h}, result)
+ assert_match(%r{testdata/abc\.x}, result)
+ assert_match(%r{(testdata/abc\..\b ?){2}}, result)
def test_inspect_pending
fl = FileList['testdata/abc.*']
- assert_equal %{["testdata/abc.c", "testdata/abc.h", "testdata/abc.x"]}, fl.inspect
+ result = fl.inspect
+ assert_match(%r{"testdata/abc\.c"}, result)
+ assert_match(%r{"testdata/abc\.h"}, result)
+ assert_match(%r{"testdata/abc\.x"}, result)
+ assert_match(%r|^\[("testdata/abc\..", ){2}"testdata/abc\.."\]$|, result)
def test_sub

0 comments on commit 0c3268a

Please sign in to comment.