resque-kawai 0.1.1 → 0.1.2
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/Gemfile.lock +1 -1
- data/LICENSE +20 -0
- data/lib/rq_queue.rb +3 -2
- data/lib/version.rb +1 -1
- data/spec/rq_queue_spec.rb +12 -2
- data/spec/test_class.rb +10 -1
- metadata +77 -48
data/Gemfile.lock
CHANGED
data/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2012 Makarchev K
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/rq_queue.rb
CHANGED
|
@@ -14,7 +14,7 @@ class RqQueue
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.extract_queue_name
|
|
17
|
-
name.gsub(
|
|
17
|
+
name.gsub(/^Rq/, '').underscore.gsub('/', '-').to_sym
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def self.add_event(method_name, *args)
|
|
@@ -52,7 +52,8 @@ class RqQueue
|
|
|
52
52
|
# proxing method for tests
|
|
53
53
|
def self.proxy(method_name)
|
|
54
54
|
self.should_receive(method_name) do |*data|
|
|
55
|
-
|
|
55
|
+
x = ::Resque.decode(::Resque.encode(data))
|
|
56
|
+
self.instance.send(method_name, *x)
|
|
56
57
|
end.any_number_of_times
|
|
57
58
|
end
|
|
58
59
|
|
data/lib/version.rb
CHANGED
data/spec/rq_queue_spec.rb
CHANGED
|
@@ -2,6 +2,15 @@ require File.dirname(__FILE__) + '/spec_helper'
|
|
|
2
2
|
require File.dirname(__FILE__) + '/test_class'
|
|
3
3
|
|
|
4
4
|
describe RqQueue do
|
|
5
|
+
|
|
6
|
+
it "queue" do
|
|
7
|
+
RqTest.instance_variable_get('@queue').should == :test
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "queue name A::B::C" do
|
|
11
|
+
A::B::C.instance_variable_get('@queue').should == :'a-b-c'
|
|
12
|
+
end
|
|
13
|
+
|
|
5
14
|
it "should enqueue defined event" do
|
|
6
15
|
Resque.should_receive(:enqueue).with(RqTest, 'bla', [1, 'a', []])
|
|
7
16
|
RqTest.bla(1, 'a', [])
|
|
@@ -67,8 +76,9 @@ describe RqQueue do
|
|
|
67
76
|
|
|
68
77
|
it "should proxy consumer" do
|
|
69
78
|
RqTest.proxy(:ptest)
|
|
70
|
-
RqTest.ptest(111)
|
|
79
|
+
RqTest.ptest(111, 'abc').should == 10
|
|
71
80
|
$a.should == 111
|
|
81
|
+
$b.should == 'abc'
|
|
72
82
|
end
|
|
73
83
|
|
|
74
|
-
end
|
|
84
|
+
end
|
data/spec/test_class.rb
CHANGED
metadata
CHANGED
|
@@ -1,59 +1,78 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: resque-kawai
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
prerelease:
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 31
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 1
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.1.2
|
|
6
11
|
platform: ruby
|
|
7
|
-
authors:
|
|
12
|
+
authors:
|
|
8
13
|
- Makarchev Konstantin
|
|
9
14
|
autorequire: resque-kawai.rb
|
|
10
15
|
bindir: bin
|
|
11
16
|
cert_chain: []
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
|
|
18
|
+
date: 2012-04-24 00:00:00 +04:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
15
22
|
name: activesupport
|
|
16
|
-
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
17
25
|
none: false
|
|
18
|
-
requirements:
|
|
19
|
-
- -
|
|
20
|
-
- !ruby/object:Gem::Version
|
|
21
|
-
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 3
|
|
30
|
+
segments:
|
|
31
|
+
- 0
|
|
32
|
+
version: "0"
|
|
22
33
|
type: :runtime
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- !ruby/object:Gem::Dependency
|
|
34
|
+
version_requirements: *id001
|
|
35
|
+
- !ruby/object:Gem::Dependency
|
|
26
36
|
name: resque
|
|
27
|
-
|
|
37
|
+
prerelease: false
|
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
28
39
|
none: false
|
|
29
|
-
requirements:
|
|
30
|
-
- -
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
hash: 3
|
|
44
|
+
segments:
|
|
45
|
+
- 0
|
|
46
|
+
version: "0"
|
|
33
47
|
type: :runtime
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- !ruby/object:Gem::Dependency
|
|
48
|
+
version_requirements: *id002
|
|
49
|
+
- !ruby/object:Gem::Dependency
|
|
37
50
|
name: rspec
|
|
38
|
-
|
|
51
|
+
prerelease: false
|
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
39
53
|
none: false
|
|
40
|
-
requirements:
|
|
41
|
-
- -
|
|
42
|
-
- !ruby/object:Gem::Version
|
|
43
|
-
|
|
54
|
+
requirements:
|
|
55
|
+
- - ">="
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
hash: 3
|
|
58
|
+
segments:
|
|
59
|
+
- 0
|
|
60
|
+
version: "0"
|
|
44
61
|
type: :development
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
description: Syntax sugar for Resque consumers. Each consumer is a class, with clean
|
|
48
|
-
interface, and custom logger. Usefull when count of different events ~100 and more.
|
|
62
|
+
version_requirements: *id003
|
|
63
|
+
description: Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger. Usefull when count of different events ~100 and more.
|
|
49
64
|
email: kostya27@gmail.com
|
|
50
65
|
executables: []
|
|
66
|
+
|
|
51
67
|
extensions: []
|
|
68
|
+
|
|
52
69
|
extra_rdoc_files: []
|
|
53
|
-
|
|
70
|
+
|
|
71
|
+
files:
|
|
54
72
|
- .gitignore
|
|
55
73
|
- Gemfile
|
|
56
74
|
- Gemfile.lock
|
|
75
|
+
- LICENSE
|
|
57
76
|
- README.md
|
|
58
77
|
- Rakefile
|
|
59
78
|
- lib/generators/rq/add_generator.rb
|
|
@@ -66,29 +85,39 @@ files:
|
|
|
66
85
|
- spec/rq_queue_spec.rb
|
|
67
86
|
- spec/spec_helper.rb
|
|
68
87
|
- spec/test_class.rb
|
|
88
|
+
has_rdoc: true
|
|
69
89
|
homepage: http://github.com/kostya/resque-kawai
|
|
70
90
|
licenses: []
|
|
91
|
+
|
|
71
92
|
post_install_message:
|
|
72
93
|
rdoc_options: []
|
|
73
|
-
|
|
94
|
+
|
|
95
|
+
require_paths:
|
|
74
96
|
- lib
|
|
75
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
98
|
none: false
|
|
77
|
-
requirements:
|
|
78
|
-
- -
|
|
79
|
-
- !ruby/object:Gem::Version
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
hash: 3
|
|
103
|
+
segments:
|
|
104
|
+
- 0
|
|
105
|
+
version: "0"
|
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
107
|
none: false
|
|
83
|
-
requirements:
|
|
84
|
-
- -
|
|
85
|
-
- !ruby/object:Gem::Version
|
|
86
|
-
|
|
108
|
+
requirements:
|
|
109
|
+
- - ">="
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
hash: 3
|
|
112
|
+
segments:
|
|
113
|
+
- 0
|
|
114
|
+
version: "0"
|
|
87
115
|
requirements: []
|
|
116
|
+
|
|
88
117
|
rubyforge_project:
|
|
89
|
-
rubygems_version: 1.
|
|
118
|
+
rubygems_version: 1.3.7
|
|
90
119
|
signing_key:
|
|
91
120
|
specification_version: 3
|
|
92
|
-
summary: Syntax sugar for Resque consumers. Each consumer is a class, with clean interface,
|
|
93
|
-
and custom logger. Usefull when count of different events ~100 and more.
|
|
121
|
+
summary: Syntax sugar for Resque consumers. Each consumer is a class, with clean interface, and custom logger. Usefull when count of different events ~100 and more.
|
|
94
122
|
test_files: []
|
|
123
|
+
|