turnpike 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,9 +16,20 @@ class Turnpike
16
16
  @options = options
17
17
  end
18
18
 
19
+ # Returns a queue. Syntactic sugar.
20
+ def [](queue)
21
+ queues[queue] ||= new(queue)
22
+ end
23
+
19
24
  def configure(&block)
20
25
  yield self
21
26
  end
27
+
28
+ private
29
+
30
+ def queues
31
+ @queues ||= Hash.new
32
+ end
22
33
  end
23
34
 
24
35
  # The name of the queue.
@@ -1,3 +1,3 @@
1
1
  class Turnpike
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -17,6 +17,11 @@ class TestTurnpike < Test::Unit::TestCase
17
17
  Turnpike.configure { |c| c.timeout = original_timeout }
18
18
  end
19
19
 
20
+ def test_bracket_method
21
+ assert_equal("turnpike:foo", Turnpike["foo"].name)
22
+ assert(Turnpike["foo"] == Turnpike["foo"])
23
+ end
24
+
20
25
  def test_emptiness
21
26
  queue = Turnpike.new
22
27
  assert(queue.empty?)
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turnpike
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 1
9
- - 2
10
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Paper Cavalier
@@ -15,39 +14,37 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-07-19 00:00:00 +01:00
17
+ date: 2011-07-22 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
21
+ name: redis
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- hash: 7
28
27
  segments:
29
28
  - 2
30
29
  - 2
31
30
  version: "2.2"
32
- name: redis
33
- prerelease: false
34
31
  type: :runtime
35
- requirement: *id001
32
+ prerelease: false
33
+ version_requirements: *id001
36
34
  - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
35
+ name: rake
36
+ requirement: &id002 !ruby/object:Gem::Requirement
38
37
  none: false
39
38
  requirements:
40
39
  - - ~>
41
40
  - !ruby/object:Gem::Version
42
- hash: 25
43
41
  segments:
44
42
  - 0
45
43
  - 9
46
44
  version: "0.9"
47
- name: rake
48
- prerelease: false
49
45
  type: :development
50
- requirement: *id002
46
+ prerelease: false
47
+ version_requirements: *id002
51
48
  description: Turnpike is a Redis-backed message processing queue.
52
49
  email:
53
50
  - code@papercavalier.com
@@ -83,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
80
  requirements:
84
81
  - - ">="
85
82
  - !ruby/object:Gem::Version
86
- hash: 3
83
+ hash: 3844900520271104281
87
84
  segments:
88
85
  - 0
89
86
  version: "0"
@@ -92,14 +89,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
89
  requirements:
93
90
  - - ">="
94
91
  - !ruby/object:Gem::Version
95
- hash: 3
92
+ hash: 3844900520271104281
96
93
  segments:
97
94
  - 0
98
95
  version: "0"
99
96
  requirements: []
100
97
 
101
98
  rubyforge_project: turnpike
102
- rubygems_version: 1.5.2
99
+ rubygems_version: 1.3.7
103
100
  signing_key:
104
101
  specification_version: 3
105
102
  summary: Turnpike is a Redis-backed message processing queue.