fake_smith 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fake_smith/version.rb +1 -1
- data/lib/fake_smith.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c136df845572e7ab0ab0626cd1d45bc95819c470
|
4
|
+
data.tar.gz: 616523a36d05ddeee705014e85035e5471bc3e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04b613410fc6babeb64f68081da36cc79327f8419129f5be7ebfac2d39eea4fdb328a6ad98d09e5691d5e0aa0d0187618bccefb30a4244d0132e6ad75f5605f4
|
7
|
+
data.tar.gz: 0337515174ec03b2e45f66b24c2e68cd1740f3b64006c235d467ccf037ad046e3c17ca6992249410d5bb29b14762f63afb7023211308991b8023dcde65d59ef6
|
data/lib/fake_smith/version.rb
CHANGED
data/lib/fake_smith.rb
CHANGED
@@ -91,13 +91,17 @@ module Smith
|
|
91
91
|
class Sender
|
92
92
|
def initialize(queue_name, &blk)
|
93
93
|
@queue_name = queue_name
|
94
|
-
blk.call
|
94
|
+
blk.call(self) if block_given?
|
95
95
|
end
|
96
96
|
|
97
97
|
def publish(message, &blk)
|
98
98
|
FakeSmith.add_message(@queue_name, message)
|
99
99
|
blk.call
|
100
100
|
end
|
101
|
+
|
102
|
+
def message_count(&blk)
|
103
|
+
blk.call FakeSmith.get_messages(@queue_name).count if block_given?
|
104
|
+
end
|
101
105
|
end
|
102
106
|
end
|
103
107
|
end
|