queued 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/queued/active_record_integration.rb +5 -1
- data/lib/queued/version.rb +1 -1
- data/lib/queued.rb +3 -0
- data/spec/queued_spec.rb +33 -0
- data/spec/queueing_proxy_spec.rb +8 -0
- data/spec/spec_helper.rb +7 -0
- metadata +5 -4
data/README.md
CHANGED
@@ -17,7 +17,7 @@ asynchronously.
|
|
17
17
|
|
18
18
|
Caveats
|
19
19
|
--------------
|
20
|
-
* A record must be saved and reachable by an `id`
|
20
|
+
* A record must be saved and reachable by an `id` field.
|
21
21
|
* Assumes a Rails application with Resque setup.
|
22
22
|
* does not handle Singleton methods (yet).
|
23
23
|
* defaults the queue name to the instance class name. the `queued` method accepts an override.
|
data/lib/queued/version.rb
CHANGED
data/lib/queued.rb
CHANGED
data/spec/queued_spec.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
|
+
|
3
|
+
describe Queued do
|
4
|
+
subject { thing }
|
5
|
+
|
6
|
+
context ".enabled" do
|
7
|
+
|
8
|
+
it "is enabled by default" do
|
9
|
+
described_class.enabled.should be(true)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "allows dis-abling" do
|
13
|
+
disabled do
|
14
|
+
described_class.enabled.should be(false)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "changes how proxies are issued" do
|
19
|
+
it "returns a proxy when enabled" do
|
20
|
+
subject.queued.should be_instance_of(Queued::QueueingProxy)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns the original object when disabled" do
|
24
|
+
disabled do
|
25
|
+
subject.queued.should be_instance_of(subject.class)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/spec/queueing_proxy_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queued
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rob Ares
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-27 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/queued/version.rb
|
106
106
|
- queued.gemspec
|
107
107
|
- spec/active_record_integration_spec.rb
|
108
|
+
- spec/queued_spec.rb
|
108
109
|
- spec/queueing_proxy_spec.rb
|
109
110
|
- spec/spec_helper.rb
|
110
111
|
has_rdoc: true
|