From 5fd244e66c498a4227d84ab4e0c365b7180851eb Mon Sep 17 00:00:00 2001 From: did Date: Mon, 6 Feb 2012 02:44:02 -0800 Subject: [PATCH] do not mention DelayedJob anymore --- doc/changelogs/version_2.txt | 2 +- .../locomotive/install/templates/README | 4 -- lib/locomotive/delayed_job.rb | 48 ------------------- script/delayed_job | 5 -- 4 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 lib/locomotive/delayed_job.rb delete mode 100755 script/delayed_job diff --git a/doc/changelogs/version_2.txt b/doc/changelogs/version_2.txt index 9c670b3f..d5531756 100644 --- a/doc/changelogs/version_2.txt +++ b/doc/changelogs/version_2.txt @@ -28,7 +28,7 @@ Installation: gem 'locomotive_cms', :path => '../../Desktop/NoCoffee/LocomotiveCMS/engine/', :require => 'locomotive/engine' gem 'unicorn' - 2/ bundle exec rails g mongoid:config + !!!!2/ bundle exec rails g mongoid:config !!! => not needed anymore 3/ bundle exec rails g locomotive:install diff --git a/lib/generators/locomotive/install/templates/README b/lib/generators/locomotive/install/templates/README index 6725ea7e..7ce9b161 100644 --- a/lib/generators/locomotive/install/templates/README +++ b/lib/generators/locomotive/install/templates/README @@ -23,8 +23,4 @@ The Locomotive Engine has been correctly installed in your Rails application. 5. Enjoy ! - Note: If you want to use DelayedJob, be sure to launch it: - - > rake jobs:work - =============================================================================== \ No newline at end of file diff --git a/lib/locomotive/delayed_job.rb b/lib/locomotive/delayed_job.rb deleted file mode 100644 index e8806d7c..00000000 --- a/lib/locomotive/delayed_job.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'delayed_job_mongoid' - -module Delayed - module Backend - module Base - module ClassMethods - # Add a job to the queue - def enqueue(*args) - object = args.shift - unless object.respond_to?(:perform) - raise ArgumentError, 'Cannot enqueue items which do not respond to perform' - end - - attributes = { - :job_type => object.class.name.demodulize.underscore, - :payload_object => object, - :priority => Delayed::Worker.default_priority, - :run_at => nil - } - - if args.first.respond_to?(:[]) - attributes.merge!(args.first) - else - attributes.merge!({ - :priority => args.first || Delayed::Worker.default_priority, - :run_at => args[1] - }) - end - - self.create(attributes) - end - end - - def failed? - failed_at.present? - end - end - - module Mongoid - class Job - field :job_type - field :step - field :site_id, :type => BSON::ObjectId - # referenced_in :site - end - end - end -end diff --git a/script/delayed_job b/script/delayed_job deleted file mode 100755 index edf19598..00000000 --- a/script/delayed_job +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) -require 'delayed/command' -Delayed::Command.new(ARGV).daemonize