Sha256: a4282c5ac287bccaa606a4f13eba5751e0f5f95206f69303a80299744d18e7b2
Contents?: true
Size: 964 Bytes
Versions: 1
Compression:
Stored size: 964 Bytes
Contents
require 'logger' require 'afterparty/queue_helpers' require 'yaml' Dir[File.expand_path('../afterparty/*', __FILE__)].each { |f| require f } module Afterparty # return timestamp of :execute_at or current time def self.queue_time job time = job_valid?(job) ? job.execute_at : DateTime.now end # returns true if job has an :execute_at value def self.job_valid? job job.respond_to?(:execute_at) && !job.execute_at.nil? end def self.load(raw) begin begin return YAML.load(raw) rescue ArgumentError => e # lots of yaml load errors are because something that hasn't been # required. recursively require on these errors # Invoke the autoloader and try again if object's class is undefined if e.message =~ /undefined class\/module (.*)$/ $1.constantize rescue return nil end return load(raw) end rescue Exception => e return nil end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
afterparty-0.2.0 | lib/afterparty.rb |