blaxter-delayed_job 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
data/lib/delayed/job.rb CHANGED
@@ -246,7 +246,7 @@ module Delayed
246
246
  # Simply resume and update the locked_at
247
247
  self.class.update_all(["locked_at = ?", now], ["id = ? and locked_by = ?", id, worker])
248
248
  end
249
- affected_rows == 1 && reload
249
+ affected_rows == 1 && reload && true
250
250
  end
251
251
 
252
252
  # Unlock this job (note: not saved to DB)
@@ -0,0 +1,40 @@
1
+ # These extensions allow properly serializing and autoloading of
2
+ # Classes, Modules and Structs
3
+
4
+ require 'yaml'
5
+
6
+ class Module
7
+ yaml_as "tag:ruby.yaml.org,2002:module"
8
+
9
+ def self.yaml_new(klass, tag, val)
10
+ val.constantize
11
+ end
12
+
13
+ def to_yaml( opts = {} )
14
+ YAML::quick_emit( nil, opts ) { |out|
15
+ out.scalar(taguri, self.name, :plain)
16
+ }
17
+ end
18
+
19
+ def yaml_tag_read_class(name)
20
+ # Constantize the object so that ActiveSupport can attempt
21
+ # its auto loading magic. Will raise LoadError if not successful.
22
+ name.constantize
23
+ name
24
+ end
25
+
26
+ end
27
+
28
+ class Class
29
+ yaml_as "tag:ruby.yaml.org,2002:class"
30
+ remove_method :to_yaml # use Module's to_yaml
31
+ end
32
+
33
+ class Struct
34
+ def self.yaml_tag_read_class(name)
35
+ # Constantize the object so that ActiveSupport can attempt
36
+ # its auto loading magic. Will raise LoadError if not successful.
37
+ name.constantize
38
+ "Struct::#{ name }"
39
+ end
40
+ end
data/lib/delayed_job.rb CHANGED
@@ -2,6 +2,7 @@ autoload :ActiveRecord, 'activerecord'
2
2
 
3
3
  require File.dirname(__FILE__) + '/delayed/message_sending'
4
4
  require File.dirname(__FILE__) + '/delayed/performable_method'
5
+ require File.dirname(__FILE__) + '/delayed/yaml_ext'
5
6
  require File.dirname(__FILE__) + '/delayed/job_handler'
6
7
  require File.dirname(__FILE__) + '/delayed/job'
7
8
  require File.dirname(__FILE__) + '/delayed/worker'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blaxter-delayed_job
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 1
10
- version: 2.1.1
9
+ - 2
10
+ version: 2.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Tobias L\xC3\xBCtke"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-16 00:00:00 +02:00
19
+ date: 2010-09-20 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -39,6 +39,7 @@ files:
39
39
  - lib/delayed/message_sending.rb
40
40
  - lib/delayed/performable_method.rb
41
41
  - lib/delayed/worker.rb
42
+ - lib/delayed/yaml_ext.rb
42
43
  - lib/delayed_job.rb
43
44
  - spec/delayed_method_spec.rb
44
45
  - spec/story_spec.rb