<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,11 @@
+== 0.3.6 / June 15th, 2009
+
+* Setting a PATH in the crontab automatically based on the user's PATH. [Javan Makhmali]
+
+
 == 0.3.5 / June 13th, 2009
 
-* Added ability to accept lists of every's and at's and intelligently group them. (ex: every 'monday, wednesday', :at =&gt; ['3pm, 6am']). [Sam Ruby]
+* Added ability to accept lists of every's and at's and intelligently group them. (ex: every 'monday, wednesday', :at =&gt; ['3pm', '6am']). [Sam Ruby]
 
 * Fixed issue with new lines. #18 [Javan Makhmali]
 </diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -57,6 +57,8 @@ module Whenever
     end
   
     def generate_cron_output
+      set_path_environment_variable
+      
       [environment_variables, cron_jobs].compact.join
     end
     
@@ -77,6 +79,19 @@ module Whenever
         set(variable.strip, value.strip) unless variable.blank? || value.blank?
       end
     end
+    
+    def set_path_environment_variable
+      return if path_should_not_be_set_automatically?
+      @env[:PATH] = read_path unless read_path.blank?
+    end
+    
+    def read_path
+      ENV['PATH'] if ENV
+    end
+    
+    def path_should_not_be_set_automatically?
+      @set_path_automatically === false || @env[:PATH] || @env[&quot;PATH&quot;]
+    end
   
     def environment_variables
       return if @env.empty?</diff>
      <filename>lib/job_list.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Whenever
   module VERSION #:nodoc:
     MAJOR = 0
     MINOR = 3
-    TINY  = 5
+    TINY  = 6
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,5 +19,38 @@ class OutputEnvTest &lt; Test::Unit::TestCase
       assert_match &quot;MAILTO=someone@example.com&quot;, @output
     end
   end
+  
+  context &quot;No PATH environment variable set&quot; do
+    setup do
+      Whenever::JobList.any_instance.expects(:read_path).at_least_once.returns('/usr/local/bin')
+      @output = Whenever.cron &quot;&quot;
+    end
+    
+    should &quot;add a PATH variable based on the user's PATH&quot; do
+      assert_match &quot;PATH=/usr/local/bin&quot;, @output
+    end
+  end
+  
+  context &quot;A PATH environment variable set&quot; do
+    setup do
+      Whenever::JobList.stubs(:read_path).returns('/usr/local/bin')
+      @output = Whenever.cron &quot;env :PATH, '/my/path'&quot;
+    end
+    
+    should &quot;use that path and the user's PATH&quot; do
+      assert_match &quot;PATH=/my/path&quot;, @output
+      assert_no_match /local/, @output
+    end
+  end
+  
+  context &quot;No PATH set and instructed not to automatically load the user's path&quot; do
+    setup do
+      @output = Whenever.cron &quot;set :set_path_automatically, false&quot;
+    end
+    
+    should &quot;not have a PATH set&quot; do
+      assert_no_match /PATH/, @output
+    end
+  end
 
 end
\ No newline at end of file</diff>
      <filename>test/output_env_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,11 @@
 
 Gem::Specification.new do |s|
   s.name = %q{whenever}
-  s.version = &quot;0.3.5&quot;
+  s.version = &quot;0.3.6&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 1.2&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Javan Makhmali&quot;]
-  s.date = %q{2009-07-13}
+  s.date = %q{2009-07-15}
   s.description = %q{Provides clean ruby syntax for defining messy cron jobs and running them Whenever.}
   s.email = %q{javan@javan.us}
   s.executables = [&quot;whenever&quot;, &quot;wheneverize&quot;]</diff>
      <filename>whenever.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ed86aeb792816291715c889e2e9c66a764b9e8e4</id>
    </parent>
  </parents>
  <author>
    <name>Javan Makhmali</name>
    <email>javan@javan.us</email>
  </author>
  <url>http://github.com/javan/whenever/commit/51a6b3720a37bb1412ae60efeba368c6f81e43e4</url>
  <id>51a6b3720a37bb1412ae60efeba368c6f81e43e4</id>
  <committed-date>2009-07-15T12:37:03-07:00</committed-date>
  <authored-date>2009-07-15T12:37:03-07:00</authored-date>
  <message>Sets the PATH automatically unless it's already provided or told not to.</message>
  <tree>400772a0edac608dc5ff3e1655a545282f69c391</tree>
  <committer>
    <name>Javan Makhmali</name>
    <email>javan@javan.us</email>
  </committer>
</commit>
