lib/tasks/patrol.rake in patrol-0.2.0 vs lib/tasks/patrol.rake in patrol-1.0.1
- old
+ new
@@ -1,29 +1,4 @@
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
-puts "patrol tasks"
+require 'patrol/tasks'
-namespace :ppatrol do
-
- desc "Launch the patrol"
- task :gooooooooooooooooooooooo => :environment do
- log = Logger.new("/tmp/patrol.log")
- output = ""
- timestamp = Time.now.strftime("%Y-%m-%d %H:%M")
- output << "[#{timestamp}] Launch the patrol "
- output << "\n"
-
- roadmap = YAML.load_file File.join(RAILS_ROOT, "config", "patrol.yml")
- roadmap.values.each do |rule|
- output << rule["title"]
- output << "\n"
- output << "=> #{eval(rule["request"])}"
- output << "\n"
- end
-
- puts output
- log.info(output)
-
- PatrolMailer.report(output).deliver
-
- end
-
-end