class RakeJob

  def self.find_rake
    rake = %x{which rake}
    if rake.nil? or rake.empty?
      raise RakeNotInstalledException
    end
    rake.chomp
  end

  def initialize(task)
    @@rake ||= RakeJob.find_rake
    @task = task
  end

  def run!
    command = "cd #{RAILS_ROOT} && #{@@rake} #{@task}"
    unless (system command)
    	raise RakeTaskNotFoundError
    end
  end
end

class RakeTaskNotFoundError < StandardError
end

class RakeNotInstalledError < StandardError
end



class RakeJob

  def self.find_rake
    rake = %x{which rake}
    if rake.nil? or rake.empty?
      raise RakeNotInstalledException
    end
    rake.chomp
  end

  def initialize(task)
    @@rake ||= RakeJob.find_rake
    @task = task
  end

  def run!
    command = "cd #{RAILS_ROOT} && #{@@rake} #{@task}"
    system command
  end
end

class RakeNotInstalledException < StandardError
end

--- 
+++ 
@@ -1,5 +1,3 @@
-
-
 class RakeJob
 
   def self.find_rake
@@ -17,9 +15,14 @@
 
   def run!
     command = "cd #{RAILS_ROOT} && #{@@rake} #{@task}"
-    system command
+    unless (system command)
+    	raise RakeTaskNotFoundError
+    end
   end
 end
 
-class RakeNotInstalledException < StandardError
+class RakeTaskNotFoundError < StandardError
 end
+
+class RakeNotInstalledError < StandardError
+end
Handle tasks that aren't found
