From e7e4a37b3af1b2abe7ee9f2090b2d8793e7b1c4f Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Mon, 18 Oct 2010 10:41:00 -0400 Subject: [PATCH] drop /usr/bin/env from rake job - let PATH do the work. added --silent flag to rake job tosupress the 'in directory' message. --- lib/whenever/job_types/default.rb | 2 +- test/functional/output_at_test.rb | 4 ++-- test/functional/output_default_defined_jobs_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/whenever/job_types/default.rb b/lib/whenever/job_types/default.rb index af90362..e9c7ec1 100644 --- a/lib/whenever/job_types/default.rb +++ b/lib/whenever/job_types/default.rb @@ -1,3 +1,3 @@ job_type :command, ":task" job_type :runner, "cd :path && script/runner -e :environment ':task'" -job_type :rake, "cd :path && RAILS_ENV=:environment /usr/bin/env rake :task" +job_type :rake, "cd :path && RAILS_ENV=:environment rake :task --silent" diff --git a/test/functional/output_at_test.rb b/test/functional/output_at_test.rb index e942715..595ccf5 100644 --- a/test/functional/output_at_test.rb +++ b/test/functional/output_at_test.rb @@ -107,7 +107,7 @@ class OutputAtTest < Test::Unit::TestCase end should "output the rake task using one entry because the times are aligned" do - assert_match '2 5,15 * * 1,3,5 cd /your/path && RAILS_ENV=production /usr/bin/env rake blah:blah', @output + assert_match '2 5,15 * * 1,3,5 cd /your/path && RAILS_ENV=production rake blah:blah --silent', @output end end @@ -167,7 +167,7 @@ class OutputAtTest < Test::Unit::TestCase end should "output all of the commands @daily" do - assert_match '@daily cd /your/path && RAILS_ENV=production /usr/bin/env rake blah:blah', @output + assert_match '@daily cd /your/path && RAILS_ENV=production rake blah:blah --silent', @output assert_match %(@daily cd /your/path && script/runner -e production 'runner_1'), @output assert_match '@daily command_1', @output assert_match %(@daily cd /your/path && script/runner -e production 'runner_2'), @output diff --git a/test/functional/output_default_defined_jobs_test.rb b/test/functional/output_default_defined_jobs_test.rb index c8d7c8d..95ce6a9 100644 --- a/test/functional/output_default_defined_jobs_test.rb +++ b/test/functional/output_default_defined_jobs_test.rb @@ -67,7 +67,7 @@ class OutputDefaultDefinedJobsTest < Test::Unit::TestCase end should "output the rake command using that path" do - assert_match two_hours + ' cd /my/path && RAILS_ENV=production /usr/bin/env rake blahblah', @output + assert_match two_hours + ' cd /my/path && RAILS_ENV=production rake blahblah --silent', @output end end @@ -83,7 +83,7 @@ class OutputDefaultDefinedJobsTest < Test::Unit::TestCase end should "output the rake command using that path" do - assert_match two_hours + ' cd /some/other/path && RAILS_ENV=production /usr/bin/env rake blahblah', @output + assert_match two_hours + ' cd /some/other/path && RAILS_ENV=production rake blahblah --silent', @output end end