delayed_job 3.0.0.pre → 3.0.0.pre2

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
@@ -228,7 +228,7 @@ You can invoke @rake jobs:clear@ to delete all jobs in the queue.
228
228
 
229
229
  h2. Mailing List
230
230
 
231
- Join us on the mailing list at http://groups.google.com/group/delayed_job
231
+ Join us on the "mailing list":http://groups.google.com/group/delayed_job
232
232
 
233
233
  h2. How to contribute
234
234
 
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'daemons'
3
2
  require 'optparse'
4
3
 
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/class/attribute'
2
+
1
3
  module Delayed
2
4
  class Plugin
3
5
  class_attribute :callback_block
@@ -1,8 +1,10 @@
1
- class ActiveRecord::Base
2
- # serialize to YAML
3
- def encode_with(coder)
4
- coder["attributes"] = @attributes
5
- coder.tag = ['!ruby/ActiveRecord', self.class.name].join(':')
1
+ if defined?(ActiveRecord)
2
+ class ActiveRecord::Base
3
+ # serialize to YAML
4
+ def encode_with(coder)
5
+ coder["attributes"] = @attributes
6
+ coder.tag = ['!ruby/ActiveRecord', self.class.name].join(':')
7
+ end
6
8
  end
7
9
  end
8
10
 
@@ -1,17 +1,19 @@
1
- class ActiveRecord::Base
2
- yaml_as "tag:ruby.yaml.org,2002:ActiveRecord"
1
+ if defined?(ActiveRecord)
2
+ class ActiveRecord::Base
3
+ yaml_as "tag:ruby.yaml.org,2002:ActiveRecord"
3
4
 
4
- def self.yaml_new(klass, tag, val)
5
- if ActiveRecord::VERSION::MAJOR == 3
6
- klass.unscoped.find(val['attributes'][klass.primary_key])
7
- else # Rails 2
8
- klass.with_exclusive_scope { klass.find(val['attributes'][klass.primary_key]) }
5
+ def self.yaml_new(klass, tag, val)
6
+ if ActiveRecord::VERSION::MAJOR == 3
7
+ klass.unscoped.find(val['attributes'][klass.primary_key])
8
+ else # Rails 2
9
+ klass.with_exclusive_scope { klass.find(val['attributes'][klass.primary_key]) }
10
+ end
11
+ rescue ActiveRecord::RecordNotFound
12
+ raise Delayed::DeserializationError
9
13
  end
10
- rescue ActiveRecord::RecordNotFound
11
- raise Delayed::DeserializationError
12
- end
13
14
 
14
- def to_yaml_properties
15
- ['@attributes']
15
+ def to_yaml_properties
16
+ ['@attributes']
17
+ end
16
18
  end
17
- end
19
+ end
@@ -165,7 +165,7 @@ module Delayed
165
165
  say "#{job.name} completed after %.4f" % runtime
166
166
  return true # did work
167
167
  rescue DeserializationError => error
168
- job.last_error = "{#{error.message}\n#{error.backtrace.join('\n')}"
168
+ job.last_error = "{#{error.message}\n#{error.backtrace.join("\n")}"
169
169
  failed(job)
170
170
  rescue Exception => error
171
171
  self.class.lifecycle.run_callbacks(:error, self, job){ handle_failed_job(job, error) }
@@ -206,7 +206,7 @@ module Delayed
206
206
  protected
207
207
 
208
208
  def handle_failed_job(job, error)
209
- job.last_error = "{#{error.message}\n#{error.backtrace.join('\n')}"
209
+ job.last_error = "{#{error.message}\n#{error.backtrace.join("\n")}"
210
210
  say "#{job.name} failed with #{error.class.name}: #{error.message} - #{job.attempts} failed attempts", Logger::ERROR
211
211
  reschedule(job)
212
212
  end
@@ -0,0 +1 @@
1
+ foo: *bar
@@ -1,8 +1,6 @@
1
1
  $:.unshift(File.dirname(__FILE__) + '/../lib')
2
2
 
3
- require 'rubygems'
4
3
  require 'bundler/setup'
5
- require 'rspec'
6
4
  require 'logger'
7
5
 
8
6
  require 'rails'
@@ -28,4 +28,14 @@ describe "YAML" do
28
28
  YAML.load(yaml).class.should == Autoloaded::InstanceClazz
29
29
  }.should_not raise_error
30
30
  end
31
+
32
+ it "should not throw an uninitialized constant Syck::Syck when using YAML.load_file with poorly formed yaml" do
33
+ lambda {
34
+ YAML.load_file(File.expand_path('spec/fixtures/bad_alias.yml'))
35
+ }.should_not raise_error
36
+ end
37
+
38
+ it "should not throw an uninitialized constant Syck::Syck when using YAML.load with poorly formed yaml" do
39
+ lambda { YAML.load(YAML.dump("foo: *bar"))}.should_not raise_error
40
+ end
31
41
  end
metadata CHANGED
@@ -1,32 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre
4
+ version: 3.0.0.pre2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
+ - Matt Griffin
9
+ - Brian Ryckbost
10
+ - Steve Richert
8
11
  - Chris Gaffney
9
12
  - Brandon Keepers
10
13
  - Tobias Lütke
11
14
  autorequire:
12
15
  bindir: bin
13
16
  cert_chain: []
14
- date: 2011-09-28 00:00:00.000000000Z
17
+ date: 2011-10-20 00:00:00.000000000Z
15
18
  dependencies:
16
19
  - !ruby/object:Gem::Dependency
17
20
  name: daemons
18
- requirement: &70127307821420 !ruby/object:Gem::Requirement
21
+ requirement: &70297904377440 !ruby/object:Gem::Requirement
19
22
  none: false
20
23
  requirements:
21
- - - ! '>='
24
+ - - =
22
25
  - !ruby/object:Gem::Version
23
- version: '0'
26
+ version: 1.0.10
24
27
  type: :runtime
25
28
  prerelease: false
26
- version_requirements: *70127307821420
29
+ version_requirements: *70297904377440
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: activesupport
29
- requirement: &70127307819760 !ruby/object:Gem::Requirement
32
+ requirement: &70297904376800 !ruby/object:Gem::Requirement
30
33
  none: false
31
34
  requirements:
32
35
  - - ~>
@@ -34,10 +37,10 @@ dependencies:
34
37
  version: '3.0'
35
38
  type: :runtime
36
39
  prerelease: false
37
- version_requirements: *70127307819760
40
+ version_requirements: *70297904376800
38
41
  - !ruby/object:Gem::Dependency
39
42
  name: activerecord
40
- requirement: &70127307818840 !ruby/object:Gem::Requirement
43
+ requirement: &70297904376300 !ruby/object:Gem::Requirement
41
44
  none: false
42
45
  requirements:
43
46
  - - ~>
@@ -45,10 +48,10 @@ dependencies:
45
48
  version: '3.0'
46
49
  type: :development
47
50
  prerelease: false
48
- version_requirements: *70127307818840
51
+ version_requirements: *70297904376300
49
52
  - !ruby/object:Gem::Dependency
50
53
  name: sqlite3
51
- requirement: &70127307818160 !ruby/object:Gem::Requirement
54
+ requirement: &70297904375900 !ruby/object:Gem::Requirement
52
55
  none: false
53
56
  requirements:
54
57
  - - ! '>='
@@ -56,10 +59,10 @@ dependencies:
56
59
  version: '0'
57
60
  type: :development
58
61
  prerelease: false
59
- version_requirements: *70127307818160
62
+ version_requirements: *70297904375900
60
63
  - !ruby/object:Gem::Dependency
61
64
  name: rails
62
- requirement: &70127307817220 !ruby/object:Gem::Requirement
65
+ requirement: &70297904375200 !ruby/object:Gem::Requirement
63
66
  none: false
64
67
  requirements:
65
68
  - - ~>
@@ -67,10 +70,10 @@ dependencies:
67
70
  version: '3.0'
68
71
  type: :development
69
72
  prerelease: false
70
- version_requirements: *70127307817220
73
+ version_requirements: *70297904375200
71
74
  - !ruby/object:Gem::Dependency
72
75
  name: rspec
73
- requirement: &70127307816440 !ruby/object:Gem::Requirement
76
+ requirement: &70297904374660 !ruby/object:Gem::Requirement
74
77
  none: false
75
78
  requirements:
76
79
  - - ~>
@@ -78,10 +81,10 @@ dependencies:
78
81
  version: '2.0'
79
82
  type: :development
80
83
  prerelease: false
81
- version_requirements: *70127307816440
84
+ version_requirements: *70297904374660
82
85
  - !ruby/object:Gem::Dependency
83
86
  name: rake
84
- requirement: &70127307815820 !ruby/object:Gem::Requirement
87
+ requirement: &70297904374280 !ruby/object:Gem::Requirement
85
88
  none: false
86
89
  requirements:
87
90
  - - ! '>='
@@ -89,7 +92,7 @@ dependencies:
89
92
  version: '0'
90
93
  type: :development
91
94
  prerelease: false
92
- version_requirements: *70127307815820
95
+ version_requirements: *70297904374280
93
96
  description: ! 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously
94
97
  executing longer tasks in the background. It is a direct extraction from Shopify
95
98
  where the job table is responsible for a multitude of core tasks.
@@ -134,6 +137,7 @@ files:
134
137
  - spec/autoloaded/struct.rb
135
138
  - spec/delayed/backend/test.rb
136
139
  - spec/delayed/serialization/test.rb
140
+ - spec/fixtures/bad_alias.yml
137
141
  - spec/lifecycle_spec.rb
138
142
  - spec/message_sending_spec.rb
139
143
  - spec/performable_mailer_spec.rb
@@ -163,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
167
  version: '0'
164
168
  segments:
165
169
  - 0
166
- hash: -811957530217889269
170
+ hash: 544689823949566531
167
171
  required_rubygems_version: !ruby/object:Gem::Requirement
168
172
  none: false
169
173
  requirements:
@@ -172,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
176
  version: 1.3.1
173
177
  requirements: []
174
178
  rubyforge_project:
175
- rubygems_version: 1.8.6
179
+ rubygems_version: 1.8.11
176
180
  signing_key:
177
181
  specification_version: 3
178
182
  summary: Database-backed asynchronous priority queue system -- Extracted from Shopify
@@ -183,6 +187,7 @@ test_files:
183
187
  - spec/autoloaded/struct.rb
184
188
  - spec/delayed/backend/test.rb
185
189
  - spec/delayed/serialization/test.rb
190
+ - spec/fixtures/bad_alias.yml
186
191
  - spec/lifecycle_spec.rb
187
192
  - spec/message_sending_spec.rb
188
193
  - spec/performable_mailer_spec.rb