delayed_job_mongoid 1.0.8 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,10 +1,18 @@
1
- # delayed_job Mongoid backend
1
+ # delayed_job Mongoid backend [![Build Status](https://secure.travis-ci.org/collectiveidea/delayed_job_mongoid.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/collectiveidea/delayed_job_mongoid.png?travis)][gemnasium] [![Code Climate](https://codeclimate.com/badge.png)][codeclimate]
2
+
3
+ [travis]: http://travis-ci.org/collectiveidea/delayed_job_mongoid
4
+ [gemnasium]: https://gemnasium.com/collectiveidea/delayed_job_mongoid
5
+ [codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job_mongoid
6
+
7
+ ## Requirements
8
+
9
+ Make sure you are using MongoDB version 1.3 or newer. `delayed_job_mongoid` uses the `findandmodify` command which is only available in recent versions.
10
+
2
11
 
3
12
  ## Installation
4
13
 
5
- Add the gems to your Gemfile:
14
+ Add the gem to your Gemfile:
6
15
 
7
- gem 'delayed_job'
8
16
  gem 'delayed_job_mongoid'
9
17
 
10
18
  After running `bundle install`, create the indexes (and don't forget to do this on your production database):
@@ -1,4 +1,8 @@
1
1
  # encoding: utf-8
2
+ require 'delayed_job'
3
+ require 'mongo'
4
+ require 'mongoid'
5
+
2
6
  module Delayed
3
7
  module Backend
4
8
  module Mongoid
@@ -16,7 +20,11 @@ module Delayed
16
20
  field :last_error, :type => String
17
21
  field :queue, :type => String
18
22
 
19
- index ([[:locked_by, -1], [:priority, 1], [:run_at, 1]])
23
+ if ::Mongoid::VERSION.to_f >= 3
24
+ index({:locked_by => -1, :priority => 1, :run_at => 1})
25
+ else
26
+ index([[:locked_by, -1], [:priority, 1], [:run_at, 1]])
27
+ end
20
28
 
21
29
  before_save :set_default_run_at
22
30
 
@@ -1,4 +1,7 @@
1
1
  # encoding: utf-8
2
+ require 'delayed_job'
3
+ require 'mongoid'
4
+
2
5
  if YAML.parser.class.name =~ /syck/i
3
6
  Mongoid::Document.class_eval do
4
7
  yaml_as "tag:ruby.yaml.org,2002:Mongoid"
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
- require 'mongoid'
3
- require 'delayed_job'
4
- require 'delayed/serialization/mongoid'
5
2
  require 'delayed/backend/mongoid'
3
+ require 'delayed/serialization/mongoid'
4
+ require 'delayed_job'
6
5
 
7
6
  Delayed::Worker.backend = :mongoid
metadata CHANGED
@@ -1,81 +1,91 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_mongoid
3
- version: !ruby/object:Gem::Version
4
- hash: 7
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 8
10
- version: 1.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Chris Gaffney
14
9
  - Brandon Keepers
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-12-30 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
13
+ date: 2012-07-26 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mongo
17
+ requirement: !ruby/object:Gem::Requirement
23
18
  none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 2
30
- - 0
31
- version: "2.0"
32
- requirement: *id001
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: '1.6'
33
23
  type: :runtime
34
24
  prerelease: false
35
- name: mongoid
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
38
26
  none: false
39
- requirements:
27
+ requirements:
40
28
  - - ~>
41
- - !ruby/object:Gem::Version
42
- hash: 7
43
- segments:
44
- - 3
45
- - 0
46
- - 0
47
- version: 3.0.0
48
- requirement: *id002
29
+ - !ruby/object:Gem::Version
30
+ version: '1.6'
31
+ - !ruby/object:Gem::Dependency
32
+ name: mongoid
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '2.0'
49
39
  type: :runtime
50
40
  prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
47
+ - !ruby/object:Gem::Dependency
51
48
  name: delayed_job
52
- - !ruby/object:Gem::Dependency
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
54
50
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 2
61
- - 0
62
- version: "2.0"
63
- requirement: *id003
64
- type: :development
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ type: :runtime
65
56
  prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '3.0'
63
+ - !ruby/object:Gem::Dependency
66
64
  name: rspec
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '2.0'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '2.0'
67
79
  description:
68
- email:
80
+ email:
69
81
  - chris@collectiveidea.com
70
82
  - brandon@opensoul.com
71
83
  executables: []
72
-
73
84
  extensions: []
74
-
75
- extra_rdoc_files:
85
+ extra_rdoc_files:
76
86
  - LICENSE
77
87
  - README.md
78
- files:
88
+ files:
79
89
  - lib/delayed/backend/mongoid.rb
80
90
  - lib/delayed/serialization/mongoid.rb
81
91
  - lib/delayed_job_mongoid.rb
@@ -85,37 +95,35 @@ files:
85
95
  - README.md
86
96
  homepage: http://github.com/collectiveidea/delayed_job_mongoid
87
97
  licenses: []
88
-
89
98
  post_install_message:
90
- rdoc_options:
99
+ rdoc_options:
91
100
  - --charset=UTF-8
92
- require_paths:
101
+ require_paths:
93
102
  - lib
94
- required_ruby_version: !ruby/object:Gem::Requirement
103
+ required_ruby_version: !ruby/object:Gem::Requirement
95
104
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 3
100
- segments:
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ segments:
101
110
  - 0
102
- version: "0"
103
- required_rubygems_version: !ruby/object:Gem::Requirement
111
+ hash: 4375365577565581306
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
113
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- hash: 3
109
- segments:
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ segments:
110
119
  - 0
111
- version: "0"
120
+ hash: 4375365577565581306
112
121
  requirements: []
113
-
114
122
  rubyforge_project:
115
- rubygems_version: 1.8.10
123
+ rubygems_version: 1.8.23
116
124
  signing_key:
117
125
  specification_version: 3
118
126
  summary: Mongoid backend for delayed_job
119
- test_files:
127
+ test_files:
120
128
  - spec/delayed_job_mongoid_spec.rb
121
129
  - spec/spec_helper.rb