bunny 1.7.0 → 1.7.1

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: ea321437a2d9950b2f2805e707dda557eef218e7
4
- data.tar.gz: fdffb1a797acfa57566398ca2fdc9c142fbfc675
3
+ metadata.gz: c6e1ab5b64d51e0a5723b686711573c11a39cf5a
4
+ data.tar.gz: f8700621a089b0f6cd594c7f2fc1d6677cd321aa
5
5
  SHA512:
6
- metadata.gz: 56cf2d1d7c7eabe6b694760e0bec181969aa33168ccf7f963aa8d6083a3476bcd35595319a4416a3e24f739358395c85fac567dc8a34bb13cdc35bf5c5ec3406
7
- data.tar.gz: 3746761d4ba98aa2eedcd6ba4f4a7d22473349b4b8a84232069dcbbde45e1fddb71906b645a73f87f5b16e0b485822694a076f15ef46ce6d0f7d7750575a306f
6
+ metadata.gz: 0682d6723a1530cfcb39b384027108ea306206fc7c275b86961d8fed701f7363688cd9cac888e97b890463bbff126194a04954dbc3821c6dd9463586182c81c5
7
+ data.tar.gz: 79e3f21253c27c279050a7c5d730a4d65e2ae122f72a64b7830e0d07c56cc108063c791f1b00b1ae9eea997088e2bcbe2d758bcb46d1ea0d65e62f004b4bc5be
@@ -1,3 +1,21 @@
1
+ ## Changes between Bunny 1.7.0 and 1.7.1
2
+
3
+ ### amq-protocol Dependendency Locked to 1.9.x
4
+
5
+ Since `amq-protocol` 2.0 requires Ruby 2.0 or later, 1.7.x versions of Bunny
6
+ must use `1.9.2`.
7
+
8
+ GH issue: [#336](https://github.com/ruby-amqp/bunny/issues/336).
9
+
10
+ ### Logger Output Remains Consistent
11
+
12
+ Setting the `@logger.progname` attribute changes the output of the logger.
13
+ This is not expected behaviour when the client provides a custom logger.
14
+ Behaviour remains unchainged when the internally initialized logger is used.
15
+
16
+ Contributed by Justin Carter.
17
+
18
+
1
19
  ## Changes between Bunny 1.6.0 and 1.7.0
2
20
 
3
21
  ### TLS Peer Verification Enabled by Default
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  map { |mail| Base64.decode64(mail) }
30
30
 
31
31
  # Dependencies
32
- s.add_dependency "amq-protocol", ">= 1.9.2"
32
+ s.add_dependency "amq-protocol", "~> 1.9.2"
33
33
 
34
34
  # Files.
35
35
  s.has_rdoc = true
@@ -5,7 +5,8 @@ module Bunny
5
5
  # TCP socket extension that uses Socket#readpartial to avoid excessive CPU
6
6
  # burn after some time. See issue #165.
7
7
  # @private
8
- class Socket < Bunny::Socket
8
+ module Socket
9
+ include Bunny::Socket
9
10
 
10
11
  # Reads given number of bytes with an optional timeout
11
12
  #
@@ -144,10 +144,11 @@ module Bunny
144
144
  @user = self.username_from(opts)
145
145
  @pass = self.password_from(opts)
146
146
  @vhost = self.vhost_from(opts)
147
- @logfile = opts[:log_file] || opts[:logfile] || STDOUT
148
147
  @threaded = opts.fetch(:threaded, true)
149
148
 
150
- @logger = opts.fetch(:logger, init_logger(opts[:log_level] || ENV["BUNNY_LOG_LEVEL"] || Logger::WARN))
149
+ log_file = opts[:log_file] || opts[:logfile] || STDOUT
150
+ log_level = opts[:log_level] || ENV["BUNNY_LOG_LEVEL"] || Logger::WARN
151
+ @logger = opts.fetch(:logger, init_default_logger(log_file, log_level))
151
152
 
152
153
  # should automatic recovery from network failures be used?
153
154
  @automatically_recover = if opts[:automatically_recover].nil? && opts[:automatic_recovery].nil?
@@ -1103,8 +1104,8 @@ module Bunny
1103
1104
  @transport.close rescue nil # Let's make sure the previous transport socket is closed
1104
1105
  @transport = Transport.new(self, host, @port, @opts.merge(:session_thread => @origin_thread))
1105
1106
 
1106
- # Reset the cached progname for the logger
1107
- @logger.progname = to_s if @logger.respond_to?(:progname)
1107
+ # Reset the cached progname for the logger only when no logger was provided
1108
+ @default_logger.progname = self.to_s
1108
1109
 
1109
1110
  @transport
1110
1111
  else
@@ -1157,12 +1158,13 @@ module Bunny
1157
1158
  end
1158
1159
 
1159
1160
  # @private
1160
- def init_logger(level)
1161
- lgr = ::Logger.new(@logfile)
1162
- lgr.level = normalize_log_level(level)
1163
- lgr.progname = self.to_s
1164
-
1165
- lgr
1161
+ def init_default_logger(logfile, level)
1162
+ @default_logger = begin
1163
+ lgr = ::Logger.new(logfile)
1164
+ lgr.level = normalize_log_level(level)
1165
+ lgr.progname = self.to_s
1166
+ lgr
1167
+ end
1166
1168
  end
1167
1169
 
1168
1170
  # @private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.7.0"
5
+ VERSION = "1.7.1"
6
6
  end
@@ -435,5 +435,10 @@ describe Bunny::Session do
435
435
 
436
436
  conn.close
437
437
  end
438
+
439
+ it "doesn't reassign the logger's progname attribute" do
440
+ expect(logger).not_to receive(:progname=)
441
+ described_class.new(:hostname => "localhost", :logger => logger)
442
+ end
438
443
  end
439
444
  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.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,20 +12,20 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-02-05 00:00:00.000000000 Z
15
+ date: 2015-08-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">="
21
+ - - "~>"
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.9.2
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">="
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
30
  version: 1.9.2
31
31
  description: Easy to use, feature complete Ruby client for RabbitMQ 3.3 and later
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  version: '0'
234
234
  requirements: []
235
235
  rubyforge_project:
236
- rubygems_version: 2.4.5
236
+ rubygems_version: 2.4.8
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: Popular easy to use Ruby client for RabbitMQ