diff --git a/History.rdoc b/History.rdoc index 9d23b6515..8906c73b7 100644 --- a/History.rdoc +++ b/History.rdoc @@ -3,6 +3,8 @@ Bug fixes: * Use sysctl for CPU count for all BSDs. Pull request #261 by Joshua Stein. +* File tasks including a ':' are now top-level tasks again. Issue #262 by + Josh Holtrop. === 10.2.0 / 2014-03-24 diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index c5348190d..af53e3f58 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -27,7 +27,8 @@ def define_task(task_class, *args, &block) # :nodoc: task_name, arg_names, deps = resolve_args(args) original_scope = @scope - if(task_name.is_a? String) + if String === task_name and + not task_class.ancestors.include? Rake::FileTask then task_name, *definition_scope = *(task_name.split(":").reverse) @scope = Scope.make(*(definition_scope + @scope.to_a)) end diff --git a/test/test_rake_directory_task.rb b/test/test_rake_directory_task.rb index 8ae7537b5..c8275e6d1 100644 --- a/test/test_rake_directory_task.rb +++ b/test/test_rake_directory_task.rb @@ -25,6 +25,12 @@ def test_directory refute File.exist?("a/b/c") end + def test_directory_colon + directory "a:b" + + assert_equal FileCreationTask, Task['a:b'].class + end unless Rake::Win32.windows? + if Rake::Win32.windows? def test_directory_win32 desc "WIN32 DESC"