Merge branch 'jobs_and_mail' into ldap

Conflicts:
	config/environments/development.rb
	config/routes.rb
This commit is contained in:
Christophe Vilayphiou committed 2012-05-08 11:45:34 +08:00
commit 65a0998080
16 files changed
+213 -12

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# require 'open-uri'
# require 'nokogiri'
class FetchTime < Resque::Plugins::RestrictionJob
restrict :per_300 => 10
@queue = :low
def self.perform()
# sleep 10
doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241'))
CronMail.time_check(doc.at('#ct').children.first.text).deliver
puts "Mail Sent"
true
end
end
+8
View File
@@ -0,0 +1,8 @@
class NccuCalendar
@queue = :high
def self.perform()
# sleep 10
puts "NccuCalendar Sync"
end
end
+9
View File
@@ -0,0 +1,9 @@
class SyncDb
@queue = :high
def self.perform()
# sleep 10
puts "DB Sync"
end
end
+8
View File
@@ -0,0 +1,8 @@
class CronMail < ActionMailer::Base
default :from => "orbit_test@rulingcom.com"
def time_check(msg)
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
mail(:to => "Matt <matt@rulingcom.com>", :subject => msg)
end
end