From dfb8935b7f39f0bc30708dc58bb3ef7750d0da83 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Tue, 21 Jul 2009 23:45:22 -0400 Subject: [PATCH] Updated the quoting of the lockrun command to use single quotes. --- lib/job_types/default.rb | 3 +-- test/output_lockrun_test.rb | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/job_types/default.rb b/lib/job_types/default.rb index 289d36c6..57b5173d 100644 --- a/lib/job_types/default.rb +++ b/lib/job_types/default.rb @@ -34,8 +34,7 @@ def wrap_task(task) def lockrunify(output) path_required - escaped_output = output - %Q{/usr/bin/env lockrun --lockfile=#{lockfile_path} -- sh -c "#{escaped_output}"} + %Q{/usr/bin/env lockrun --lockfile=#{lockfile_path} -- sh -c '#{output}'} end def lockfile_path diff --git a/test/output_lockrun_test.rb b/test/output_lockrun_test.rb index b9b2a286..35182340 100644 --- a/test/output_lockrun_test.rb +++ b/test/output_lockrun_test.rb @@ -15,7 +15,7 @@ class OutputLockrunTest < Test::Unit::TestCase end should "output the command wrapped by lockrun with the default lockfile" do - assert_match two_hours + %Q{ /usr/bin/env lockrun --lockfile=/some/directory/log/default.lockrun -- sh -c "blahblah"}, @output + assert_match two_hours + %Q{ /usr/bin/env lockrun --lockfile=/some/directory/log/default.lockrun -- sh -c 'blahblah'}, @output end end @@ -30,10 +30,8 @@ class OutputLockrunTest < Test::Unit::TestCase file end - "cd #{@path} && RAILS_ENV=#{@environment} /usr/bin/env rake #{task}" - should "output the command wrapped by lockrun with the default lockfile" do - assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/my/super/directory/log/default.lockrun -- sh -c "cd /my/super/directory && RAILS_ENV=production /usr/bin/env rake blahblah"}, @output + assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/my/super/directory/log/default.lockrun -- sh -c 'cd /my/super/directory && RAILS_ENV=production /usr/bin/env rake blahblah'}, @output end end @@ -49,7 +47,7 @@ class OutputLockrunTest < Test::Unit::TestCase end should "output the command wrapped by lockrun with the default lockfile" do - assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/my/directory/log/default.lockrun -- sh -c "/my/directory/script/runner -e production \"blahblah\""}, @output + assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/my/directory/log/default.lockrun -- sh -c '/my/directory/script/runner -e production "blahblah"'}, @output end end @@ -65,7 +63,7 @@ class OutputLockrunTest < Test::Unit::TestCase end should "output the command wrapped by lockrun with the zomg lockfile" do - assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/some/directory/log/zomg.lockrun -- sh -c "blahblah"}, @output + assert_includes %Q{#{two_hours} /usr/bin/env lockrun --lockfile=/some/directory/log/zomg.lockrun -- sh -c 'blahblah'}, @output end end