bunny 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f95620700698a7454edd541d700d95a4e22a1a9
4
- data.tar.gz: 81f998684077b3d122e940658e86cda2040a853a
3
+ metadata.gz: 65bba4f160af1169e1e2d7f1e15045dad3fafb21
4
+ data.tar.gz: 38db4dd54e20cd407012b4e81da4a537585fe7db
5
5
  SHA512:
6
- metadata.gz: c83a741435482dd6557897ca71bb8e8c52721be25922452cb981b8a9234f559a87aabd30c62cbbb5ad69bc923ccf95ff32ed961ea8cefa101435e82d488983da
7
- data.tar.gz: 7428abd9b8badf6ffd6d8925f44a61516d21c8a11a95bdb238c0456753e61fb33448cfb396d39a02ff3ca4e6b18e4eecdbc96530d223af85f5ecdb2921cc796e
6
+ metadata.gz: 180fcfdee5da277fb7d4e7d1249cfd0dda89f62539f3da1c669591468fc1b3a93d69e66334756aa151187ee799401b57648a04e99f0addaafc06f3409f7ac6ad
7
+ data.tar.gz: 56906a33ce0109360cb65cfce44aed78bb0ae7c100369e4bda8f7531aa4153ba69fda011b8d4b699718b5590ab8460f46ae5355ee4fec5cb33f6c5ef63771d5c
@@ -1,3 +1,11 @@
1
+ ## Changes between Bunny 1.0.2 and 1.0.3
2
+
3
+ ### Eliminated Errouneous Debug Statement
4
+
5
+ `1.0.3` eliminates a debug log message that should have
6
+ never made it into a commit.
7
+
8
+
1
9
  ## Changes between Bunny 1.0.1 and 1.0.2
2
10
 
3
11
  ### Fixes CPU Burn on JRuby
@@ -21,6 +21,7 @@ module Bunny
21
21
  @n
22
22
  end
23
23
  end
24
+ alias to_i get
24
25
 
25
26
  def set(n)
26
27
  @mutex.synchronize do
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.0.3"
5
+ VERSION = "1.0.4"
6
6
  end
@@ -11,8 +11,8 @@ module Bunny
11
11
  raise ArgumentError.new("tag cannot be nil") unless tag
12
12
  raise ArgumentError.new("version cannot be nil") unless version
13
13
 
14
- @tag = tag
15
- @version = version
14
+ @tag = tag.to_i
15
+ @version = version.to_i
16
16
  end
17
17
 
18
18
  def to_i
@@ -22,7 +22,7 @@ module Bunny
22
22
  def stale?(version)
23
23
  raise ArgumentError.new("version cannot be nil") unless version
24
24
 
25
- @version < version
25
+ @version < version.to_i
26
26
  end
27
27
  end
28
28
  end
@@ -0,0 +1,28 @@
1
+ require "spec_helper"
2
+
3
+ require "bunny/concurrent/atomic_fixnum"
4
+ require "bunny/versioned_delivery_tag"
5
+
6
+ describe Bunny::VersionedDeliveryTag, "#stale?" do
7
+ subject { described_class.new(2, 1) }
8
+
9
+ context "when delivery tag version < provided version" do
10
+ it "returns true" do
11
+ subject.stale?(2).should be_true
12
+ end
13
+ end
14
+
15
+ context "when delivery tag version = provided version" do
16
+ it "returns false" do
17
+ subject.stale?(1).should be_false
18
+ end
19
+ end
20
+
21
+ context "when delivery tag version > provided version" do
22
+ it "returns true" do
23
+ # this scenario is unrealistic but we still can
24
+ # unit test it. MK.
25
+ subject.stale?(0).should be_false
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-11-06 00:00:00.000000000 Z
15
+ date: 2013-11-18 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
@@ -203,6 +203,7 @@ files:
203
203
  - spec/unit/concurrent/linked_continuation_queue_spec.rb
204
204
  - spec/unit/concurrent/synchronized_sorted_set_spec.rb
205
205
  - spec/unit/system_timer_spec.rb
206
+ - spec/unit/version_delivery_tag_spec.rb
206
207
  homepage: http://rubybunny.info
207
208
  licenses:
208
209
  - MIT
@@ -297,4 +298,5 @@ test_files:
297
298
  - spec/unit/concurrent/linked_continuation_queue_spec.rb
298
299
  - spec/unit/concurrent/synchronized_sorted_set_spec.rb
299
300
  - spec/unit/system_timer_spec.rb
301
+ - spec/unit/version_delivery_tag_spec.rb
300
302
  has_rdoc: true