def job_type(name, template)
singleton_class_shim.class_eval do
define_method(name) do |task, *args|
options = { :task => task, :template => template }
options.merge!(args[0]) if args[0].is_a? Hash
options[:output] = (options[:cron_log] || @cron_log) if defined?(@cron_log) || options.has_key?(:cron_log)
options[:output] = @output if defined?(@output) && !options.has_key?(:output)
@jobs[@current_time_scope] ||= []
@jobs[@current_time_scope] << Whenever::Job.new(@options.merge(@set_variables).merge(options))
end
end
end