Skip to content

Commit 15f9169

Browse files
committed
Make space trimming consistent for all task arguments. Fixes #260
1 parent 25c29b6 commit 15f9169

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/rake/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def parse_task_string(string) # :nodoc:
172172
args = []
173173

174174
begin
175-
/((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
175+
/\s*((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
176176

177177
remaining_args = $2
178178
args << $1.gsub(/\\(.)/, '\1')

test/test_rake_task_argument_parsing.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def test_two_arguments
3232
assert_equal ["one", "two"], args
3333
end
3434

35-
def test_can_handle_spaces_between_args
36-
name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]")
35+
def test_can_handle_spaces_between_all_args
36+
name, args = @app.parse_task_string("name[ one , two ,\tthree , \tfour ]")
3737
assert_equal "name", name
3838
assert_equal ["one", "two", "three", "four"], args
3939
end

0 commit comments

Comments
 (0)