bunny 0.7.5 → 0.7.6

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/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  .yardoc
8
8
  .rvmrc
9
9
  Gemfile.lock
10
+ .rbx/*
data/.travis.yml CHANGED
@@ -3,9 +3,10 @@ bundler_args: --without development
3
3
  script: "bundle exec rspec spec"
4
4
  rvm:
5
5
  - 1.8.7
6
- - 1.9.2
7
6
  - ree
8
- - 1.8.7-p174
7
+ - 1.9.2
8
+ - 1.9.3
9
+ - rbx-2.0
9
10
  notifications:
10
11
  recipients:
11
12
  - celldee@gmail.com
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = Version 0.7.6
2
+
3
+ * API mismatch between Timer/SystemTimer on Ruby 1.9 vs Ruby 1.8 is resolved.
4
+
1
5
  = Version 0.7.3
2
6
 
3
7
  * AMQP connection URI parser now respects port
data/lib/bunny.rb CHANGED
@@ -67,8 +67,8 @@ module Bunny
67
67
 
68
68
  Timer = if RUBY_VERSION < "1.9"
69
69
  begin
70
- require 'system_timer'
71
- SystemTimer
70
+ require File.expand_path(File.join(File.dirname(__FILE__), 'system_timer.rb'))
71
+ Bunny::SystemTimer
72
72
  rescue LoadError
73
73
  Timeout
74
74
  end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ module Bunny
4
+ # Used for ruby < 1.9.x
5
+ class SystemTimer < ::SystemTimer
6
+
7
+ def timeout(seconds, exception)
8
+ timeout_after(seconds) do
9
+ yield
10
+ end
11
+ end
12
+
13
+ end
14
+ end
data/lib/bunny/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Bunny
4
- VERSION = "0.7.5"
4
+ VERSION = "0.7.6"
5
5
  end
@@ -11,5 +11,15 @@ describe Bunny do
11
11
  lambda { b.start}.should raise_error(Bunny::ProtocolError)
12
12
  end
13
13
 
14
+ it "should be able to open a TCPSocket with a timeout" do
15
+ b = Bunny.new(:spec => "0.8")
16
+ connect_timeout = 1
17
+ lambda {
18
+ Bunny::Timer::timeout(connect_timeout, Qrack::ConnectionTimeout) do
19
+ TCPSocket.new(b.host, b.port)
20
+ end
21
+ }.should_not raise_error(Exception)
22
+ end
23
+
14
24
  end
15
25
 
@@ -16,4 +16,14 @@ describe Bunny do
16
16
  b.host.should eql("tagadab")
17
17
  end
18
18
 
19
+ it "should be able to open a TCPSocket with a timeout" do
20
+ b = Bunny.new(:spec => "0.9")
21
+ connect_timeout = 1
22
+ lambda {
23
+ Bunny::Timer::timeout(connect_timeout, Qrack::ConnectionTimeout) do
24
+ TCPSocket.new(b.host, b.port)
25
+ end
26
+ }.should_not raise_error(Exception)
27
+ end
28
+
19
29
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 5
10
- version: 0.7.5
9
+ - 6
10
+ version: 0.7.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Duncan
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-09-11 00:00:00 +04:00
22
+ date: 2011-09-21 00:00:00 +04:00
23
23
  default_executable:
24
24
  dependencies: []
25
25
 
@@ -77,6 +77,7 @@ files:
77
77
  - lib/bunny/queue09.rb
78
78
  - lib/bunny/subscription08.rb
79
79
  - lib/bunny/subscription09.rb
80
+ - lib/bunny/system_timer.rb
80
81
  - lib/bunny/version.rb
81
82
  - lib/qrack/amq-client-url.rb
82
83
  - lib/qrack/channel.rb
@@ -107,7 +108,7 @@ has_rdoc: true
107
108
  homepage: http://github.com/ruby-amqp/bunny
108
109
  licenses: []
109
110
 
110
- post_install_message: "[\e[32mVersion 0.7.3\e[0m] AMQP connection URI parser now respects port\n"
111
+ post_install_message: "[\e[32mVersion 0.7.6\e[0m] API mismatch between Timer/SystemTimer on Ruby 1.9 vs Ruby 1.8 is resolved.\n"
111
112
  rdoc_options:
112
113
  - --main
113
114
  - README.rdoc