Author: assaf
Date: Thu Sep 25 09:14:10 2008
New Revision: 699011
URL: http://svn.apache.org/viewvc?rev=699011&view=rev
Log:
Fixed: Project.task fails when task name starts with a colon.
Modified:
incubator/buildr/trunk/CHANGELOG
incubator/buildr/trunk/lib/buildr/core/project.rb
incubator/buildr/trunk/spec/core/project_spec.rb
Modified: incubator/buildr/trunk/CHANGELOG
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/CHANGELOG?rev=699011&r1=699010&r2=699011&view=diff
==============================================================================
--- incubator/buildr/trunk/CHANGELOG (original)
+++ incubator/buildr/trunk/CHANGELOG Thu Sep 25 09:14:10 2008
@@ -49,6 +49,7 @@
* Fixed: Release task's regexp to find either THIS_VERSION and VERSION_NUMBER.
* Fixed: BUILDR-138 ScalaTest premature use of Buildr::Repositories
inconsistent with customizing locations.
+* Fixed: Project.task fails when task name starts with a colon.
* Docs: BUILDR-111 Troubleshoot tip when Buildr's bin directory shows up in
RUBYLIB (Geoffrey Ruscoe).
Modified: incubator/buildr/trunk/lib/buildr/core/project.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/project.rb?rev=699011&r1=699010&r2=699011&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/project.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/project.rb Thu Sep 25 09:14:10 2008
@@ -515,8 +515,8 @@
def task(*args, &block)
task_name, arg_names, deps = Buildr.application.resolve_args(args)
if task_name =~ /^:/
- Buildr.application.switch_to_namespace [] do
- task = Rake::Task.define_task(task_name[1..-1])
+ task = Buildr.application.switch_to_namespace [] do
+ Rake::Task.define_task(task_name[1..-1])
end
elsif Buildr.application.current_scope == name.split(':')
task = Rake::Task.define_task(task_name)
Modified: incubator/buildr/trunk/spec/core/project_spec.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/project_spec.rb?rev=699011&r1=699010&r2=699011&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/core/project_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/project_spec.rb Thu Sep 25 09:14:10 2008
@@ -644,6 +644,13 @@
define('foo') { task('bar') }
project('foo').task('bar').name.should eql('foo:bar')
end
+
+ it 'should ignore namespace if starting with color' do
+ define 'foo' do
+ task(':bar').name.should == 'bar'
+ end
+ Rake::Task.task_defined?('bar').should be_true
+ end
it 'should accept single dependency' do
define('foo') { task('bar'=>'baz') }