simple_resque 1.0.3 → 1.1.0
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/README.md +5 -6
- data/Rakefile +0 -5
- data/lib/simple_resque.rb +1 -1
- data/lib/simple_resque/version.rb +1 -1
- data/spec/integration/resque_operations_spec.rb +2 -2
- data/spec/lib/simple_resque_spec.rb +1 -1
- metadata +6 -6
data/README.md
CHANGED
@@ -4,11 +4,11 @@ I needed a simple way to queue Resque jobs from a web app where the jobs were de
|
|
4
4
|
codebase, running completely independently from the web app. Unfortunately,
|
5
5
|
Resque requires you to pass the class name of a job as a constant, when what I
|
6
6
|
really needed was to pass a string which would get turned into a constant class
|
7
|
-
name by the worker codebase.
|
8
|
-
underscored version of the class name.
|
7
|
+
name by the worker codebase.
|
9
8
|
|
10
9
|
I had to do this enough times that I decided to wrap the idiom in a gem, figuring that over time
|
11
|
-
I'll need to add other simplifications of the Resque API.
|
10
|
+
I'll need to add other simplifications of the Resque API. The gem assumes that the queue name is an
|
11
|
+
underscored version of the class name.
|
12
12
|
|
13
13
|
# Installation
|
14
14
|
|
@@ -18,7 +18,7 @@ I'll need to add other simplifications of the Resque API.
|
|
18
18
|
|
19
19
|
require 'simple_resque'
|
20
20
|
|
21
|
-
# puts a job on the transmogrifier queue with class "Transmogrifier" and
|
21
|
+
# puts a job on the "transmogrifier" queue with class "Transmogrifier" and
|
22
22
|
# arguments { id: 3, state: "back_to_calvin" }
|
23
23
|
|
24
24
|
SimpleResque.push("Transmogrifier",id: 3, state: "back_to_calvin")
|
@@ -33,8 +33,7 @@ I'll need to add other simplifications of the Resque API.
|
|
33
33
|
|
34
34
|
# Problems? Questions?
|
35
35
|
|
36
|
-
Email <mike@subelsky.com> or file an issue on
|
37
|
-
[GitHub](https://github.com/subelsky/simple_resque).
|
36
|
+
Email <mike@subelsky.com> or file an issue on [GitHub](https://github.com/subelsky/simple_resque).
|
38
37
|
|
39
38
|
Patches are welcome. Thanks!
|
40
39
|
|
data/Rakefile
CHANGED
@@ -5,11 +5,6 @@ require "bundler"
|
|
5
5
|
|
6
6
|
desc "release"
|
7
7
|
task :release do
|
8
|
-
unless system("git diff --exit-code")
|
9
|
-
puts "Git not clean. Aborting."
|
10
|
-
`growlnotify -m 'gem release failed'; say 'gem release failed'`
|
11
|
-
end
|
12
|
-
|
13
8
|
require "./lib/simple_resque/version.rb"
|
14
9
|
|
15
10
|
puts "Getting ready to tag and release #{SimpleResque::VERSION} - is this correct?"
|
data/lib/simple_resque.rb
CHANGED
@@ -4,7 +4,7 @@ require "simple_resque"
|
|
4
4
|
describe "Pushing a job to Resque" do
|
5
5
|
it "suceeds" do
|
6
6
|
expect {
|
7
|
-
SimpleResque.push("TransformVehicle",
|
7
|
+
SimpleResque.push("TransformVehicle",5, "autobot")
|
8
8
|
}.to change { Resque.size(:transform_vehicle) }.from(0).to(1)
|
9
9
|
|
10
10
|
job = Resque.pop(:transform_vehicle)
|
@@ -28,7 +28,7 @@ describe "Popping jobs from Resque" do
|
|
28
28
|
it "succeeds" do
|
29
29
|
SimpleResque.clear("BuyStuff")
|
30
30
|
SimpleResque.push("Shaz",%q(1 2 3))
|
31
|
-
SimpleResque.pop("Shaz").should == { "class" => "Shaz", "args" => %q(1 2 3) }
|
31
|
+
SimpleResque.pop("Shaz").should == { "class" => "Shaz", "args" => [%q(1 2 3)] }
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -7,7 +7,7 @@ describe SimpleResque do
|
|
7
7
|
before { SimpleResque.resque = resque_stub }
|
8
8
|
|
9
9
|
it "creates a proper push request from the given parameters" do
|
10
|
-
resque_stub.should_receive(:push).with("transmogrifier",class: "Transmogrifier",args: { id: 3, state: "back_to_calvin" })
|
10
|
+
resque_stub.should_receive(:push).with("transmogrifier",class: "Transmogrifier",args: [{ id: 3, state: "back_to_calvin" }])
|
11
11
|
SimpleResque.push("Transmogrifier",id: 3, state: "back_to_calvin")
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_resque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: resque
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153123280 !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: *
|
24
|
+
version_requirements: *2153123280
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &2153122860 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153122860
|
36
36
|
description: Provides a simpler interface to enqueue Resque jobs between codebases
|
37
37
|
without having to define the Jobs in multiple codebases.
|
38
38
|
email: mike@subelsky.com
|