We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8aba43 commit 00aacdcCopy full SHA for 00aacdc
lib/rake/task_manager.rb
@@ -133,8 +133,8 @@ def resolve_args_with_dependencies(args, hash) # :nodoc:
133
deps = value || []
134
else
135
task_name = args.shift
136
- arg_names = key
137
- deps = value
+ arg_names = key || args.shift|| []
+ deps = value || []
138
end
139
deps = [deps] unless deps.respond_to?(:to_ary)
140
[task_name, arg_names, deps, order_only]
test/test_rake_task_manager_argument_resolution.rb
@@ -8,9 +8,16 @@ def test_good_arg_patterns
8
assert_equal [:t, [], [:x], nil], task(t: :x)
9
assert_equal [:t, [], [:x, :y], nil], task(t: [:x, :y])
10
11
+ assert_equal [:t, [], [], [:m]], task(:t, order_only: [:m])
12
+ assert_equal [:t, [], [:x, :y], [:m, :n]], task(t: [:x, :y], order_only: [:m, :n])
13
+
14
assert_equal [:t, [:a, :b], [], nil], task(:t, [:a, :b])
15
assert_equal [:t, [:a, :b], [:x], nil], task(:t, [:a, :b] => :x)
16
assert_equal [:t, [:a, :b], [:x, :y], nil], task(:t, [:a, :b] => [:x, :y])
17
18
+ assert_equal [:t, [:a, :b], [], [:m]], task(:t, [:a, :b], order_only: [:m])
19
+ assert_equal [:t, [:a, :b], [:x], [:m]], task(:t, [:a, :b] => :x, order_only: [:m])
20
+ assert_equal [:t, [:a, :b], [:x, :y], [:m, :n]], task(:t, [:a, :b] => [:x, :y], order_only: [:m, :n])
21
22
23
def task(*args)
0 commit comments