delayed_job_shallow_mongoid 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "delayed_job_shallow_mongoid"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Joey Aghion"]
@@ -13,5 +13,13 @@ module Delayed
13
13
  rescue Mongoid::Errors::DocumentNotFound
14
14
  true # do nothing if document has been removed
15
15
  end
16
+
17
+ def display_name
18
+ if object.is_a?(ShallowMongoid::DocumentStub)
19
+ return "#{object.klass}[#{object.id}]##{method_name}"
20
+ else
21
+ "#{object.class}##{method_name}"
22
+ end
23
+ end
16
24
  end
17
25
  end
@@ -1,4 +1,7 @@
1
1
  module Delayed::ShallowMongoid
2
2
  class DocumentStub < Struct.new(:klass, :id)
3
+ def display_name
4
+ "#{klass}[#{id}]##{method_name}"
5
+ end
3
6
  end
4
7
  end
@@ -48,6 +48,17 @@ describe ::Delayed::PerformableMethod do
48
48
  @method.perform.should be_true
49
49
  end
50
50
  end
51
+
52
+ context "display_name" do
53
+ it "should return underlying class when a stub is being used" do
54
+ @method = ::Delayed::PerformableMethod.new(@model, :to_s, [])
55
+ @method.display_name.should == "TestModel[#{@model._id}]#to_s"
56
+ end
57
+ it "should return usual name when no stub is involved" do
58
+ @method = ::Delayed::PerformableMethod.new(:test, :to_s, [])
59
+ @method.display_name.should == "Symbol#to_s"
60
+ end
61
+ end
51
62
  end
52
63
 
53
64
  describe ::Delayed::PerformableMailer do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_shallow_mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionmailer
16
- requirement: &2168634720 !ruby/object:Gem::Requirement
16
+ requirement: &2169809620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2168634720
24
+ version_requirements: *2169809620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: delayed_job_mongoid
27
- requirement: &2168632740 !ruby/object:Gem::Requirement
27
+ requirement: &2169809020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2168632740
35
+ version_requirements: *2169809020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &2168628960 !ruby/object:Gem::Requirement
38
+ requirement: &2169808440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2168628960
46
+ version_requirements: *2169808440
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &2168626360 !ruby/object:Gem::Requirement
49
+ requirement: &2169807880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2168626360
57
+ version_requirements: *2169807880
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &2168624280 !ruby/object:Gem::Requirement
60
+ requirement: &2169807400 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2168624280
68
+ version_requirements: *2169807400
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &2168617660 !ruby/object:Gem::Requirement
71
+ requirement: &2169806920 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2168617660
79
+ version_requirements: *2169806920
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &2168616520 !ruby/object:Gem::Requirement
82
+ requirement: &2169806440 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2168616520
90
+ version_requirements: *2169806440
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: ruby-debug19
93
- requirement: &2168613960 !ruby/object:Gem::Requirement
93
+ requirement: &2169805960 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2168613960
101
+ version_requirements: *2169805960
102
102
  description: When the object or arg to a delayed_job is a Mongoid document, store
103
103
  only a small stub of the object instead of the full serialization.
104
104
  email: joey@aghion.com
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: -1287393219772870351
143
+ hash: 2107610235434082620
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements: