aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rake/dsl_definition.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake/dsl_definition.rb')
-rw-r--r--lib/rake/dsl_definition.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb
index 6d9a6b88f3..143b0bcf7a 100644
--- a/lib/rake/dsl_definition.rb
+++ b/lib/rake/dsl_definition.rb
@@ -52,8 +52,8 @@ module Rake
# Declare a file creation task.
# (Mainly used for the directory command).
- def file_create(args, &block)
- Rake::FileCreationTask.define_task(args, &block)
+ def file_create(*args, &block)
+ Rake::FileCreationTask.define_task(*args, &block)
end
# Declare a set of files tasks to create the given directories on
@@ -62,12 +62,15 @@ module Rake
# Example:
# directory "testdata/doc"
#
- def directory(dir)
+ def directory(*args, &block)
+ result = file_create(*args, &block)
+ dir, _ = *Rake.application.resolve_args(args)
Rake.each_dir_parent(dir) do |d|
file_create d do |t|
mkdir_p t.name if ! File.exist?(t.name)
end
end
+ result
end
# Declare a task that performs its prerequisites in
@@ -78,8 +81,8 @@ module Rake
# Example:
# multitask :deploy => [:deploy_gem, :deploy_rdoc]
#
- def multitask(args, &block)
- Rake::MultiTask.define_task(args, &block)
+ def multitask(*args, &block)
+ Rake::MultiTask.define_task(*args, &block)
end
# Create a new rake namespace and use it for evaluating the given
@@ -167,10 +170,13 @@ module Rake
private :#{name}
}, __FILE__, line
end
- end
+ end unless defined? Rake::REDUCE_COMPAT
extend FileUtilsExt
end
+# Extend the main object with the DSL commands. This allows top-level
+# calls to task, etc. to work from a Rakefile without polluting the
+# object inheritance tree.
self.extend Rake::DSL
-include Rake::DeprecatedObjectDSL
+include Rake::DeprecatedObjectDSL unless defined? Rake::REDUCE_COMPAT