Hello community, here is the log from the commit of package rubygem-stomp for openSUSE:Factory checked in at 2016-10-10 16:22:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-stomp (Old) and /work/SRC/openSUSE:Factory/.rubygem-stomp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-stomp" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-stomp/rubygem-stomp.changes 2016-09-21 18:47:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-stomp.new/rubygem-stomp.changes 2016-10-10 16:22:45.000000000 +0200 @@ -1,0 +2,30 @@ +Sat Sep 10 04:39:54 UTC 2016 - coolo@suse.com + +- updated to version 1.4.3 + see installed CHANGELOG.md + + ## 1.4.3 20160821 + + * Quick fix of install failures. Do not try to use install 1.4.2. + +------------------------------------------------------------------- +Sun Aug 21 04:39:11 UTC 2016 - coolo@suse.com + +- updated to version 1.4.2 + see installed CHANGELOG.md + + ## 1.4.2 20160820 + + * Refine SSL examples. + * Address issue #124 with additional RDOC. + * spec for Stomp::Client - check that headers passed to connection contain + required values as well as given custom and that given hash is not modified. + * Stomp::Client now does not modify given headers hash + * spec description enhancement. + * fix build_subscription_id - symbol and string were mixed up. + * STOMP_TESTSSL flag should enable all SSL tests. + * Add a basic Gemfile. + * Fix a memory leak in receipt implementation. + * Add unit test helper script. + +------------------------------------------------------------------- Old: ---- stomp-1.4.1.gem New: ---- stomp-1.4.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-stomp.spec ++++++ --- /var/tmp/diff_new_pack.BpfjvK/_old 2016-10-10 16:22:47.000000000 +0200 +++ /var/tmp/diff_new_pack.BpfjvK/_new 2016-10-10 16:22:47.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-stomp -Version: 1.4.1 +Version: 1.4.3 Release: 0 %define mod_name stomp %define mod_full_name %{mod_name}-%{version} ++++++ stomp-1.4.1.gem -> stomp-1.4.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-06-23 21:27:59.000000000 +0200 +++ new/CHANGELOG.md 2016-08-22 00:54:57.000000000 +0200 @@ -1,5 +1,23 @@ # Stomp Gem Change Log +## 1.4.3 20160821 + +* Quick fix of install failures. Do not try to use install 1.4.2. + +## 1.4.2 20160820 + +* Refine SSL examples. +* Address issue #124 with additional RDOC. +* spec for Stomp::Client - check that headers passed to connection contain + required values as well as given custom and that given hash is not modified. +* Stomp::Client now does not modify given headers hash +* spec description enhancement. +* fix build_subscription_id - symbol and string were mixed up. +* STOMP_TESTSSL flag should enable all SSL tests. +* Add a basic Gemfile. +* Fix a memory leak in receipt implementation. +* Add unit test helper script. + ## 1.4.1 20160623 * Add call to #post_connection_check to normal SSL processing. This change diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2016-06-23 21:27:59.000000000 +0200 +++ new/README.md 2016-08-22 00:54:57.000000000 +0200 @@ -93,6 +93,8 @@ See _CHANGELOG.rdoc_ for details. +* Gem version 1.4.3. Fix broken install. Do not try to install 1.4.2. +* Gem version 1.4.2. Fix memory leak, and others !: see CHANGELOG.md for details. * Gem version 1.4.1. Important SSL changes !: see CHANGELOG.md for details. * Gem version 1.4.0. Note: Change sementics of :parse_timeout, see CHANGELOG.md for details. * Gem version 1.3.5. Miscellaneous fixes, see CHANGELOG.rdoc for details. @@ -291,7 +293,7 @@ 2009-12-25 </td> <td style="border: 1px solid black;padding-left: 10px;" > -(0362) +(0369) </td> <td style="border: 1px solid black;padding-left: 10px;" > <span style="font-weight: bold;" > @@ -706,5 +708,60 @@ / wayne.robinson@gmail.com </td> </tr> +<tr> +<td style="border: 1px solid black;padding-left: 10px;" > +2016-07-12 +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +(0006) +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +<span style="font-weight: bold;" > +Nikolay Khasanov +</span> + / nkhasanov@groupon.com +</td> +</tr> +<tr> +<td style="border: 1px solid black;padding-left: 10px;" > +2016-07-16 +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +(0004) +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +<span style="font-weight: bold;" > +GitHub +</span> + / noreply@github.com +</td> +</tr> +<tr> +<td style="border: 1px solid black;padding-left: 10px;" > +2016-06-02 +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +(0001) +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +<span style="font-weight: bold;" > +Ryan Rosenblum +</span> + / ryan.rosenblum@gmail.com +</td> +</tr> +<tr> +<td style="border: 1px solid black;padding-left: 10px;" > +2016-08-17 +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +(0002) +</td> +<td style="border: 1px solid black;padding-left: 10px;" > +<span style="font-weight: bold;" > +Alexandre Moutot +</span> + / a.moutot@alphalink.fr +</td> +</tr> </table> - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2016-06-23 21:27:59.000000000 +0200 +++ new/Rakefile 2016-08-22 00:54:57.000000000 +0200 @@ -39,7 +39,7 @@ gem.homepage = "https://github.com/stompgem/stomp" gem.authors = ["Brian McCallister", 'Marius Mathiesen', 'Thiago Morello', 'Guy M. Allard'] - gem.add_development_dependency "rspec", '>= 2.14.1' + gem.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1' end Jeweler::GemcutterTasks.new rescue LoadError Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_common.rb new/examples/ssl_common.rb --- old/examples/ssl_common.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/examples/ssl_common.rb 2016-08-22 00:54:57.000000000 +0200 @@ -0,0 +1,73 @@ +# -*- encoding: utf-8 -*- + +# +# Common Stomp 1.1 code. +# +require "rubygems" if RUBY_VERSION < "1.9" +require "stomp" +# +module SSLCommon + + # CA Data. + + # CA file location/directory. Change or specify. + # This is the author's default. + def ca_loc() + ENV['CA_FLOC'] || "/ad3/gma/sslwork/2013-extended-02" # The CA cert location + end + # CA file. Change or specify. + # This is the author's default. + def ca_cert() + ENV['CA_FILE'] || "TestCA.crt" # The CA cert File + end + # CA private key file. Change or specify. + # This is the author's default. + # This file should not be exposed to the outside world. + # Not currently used in stomp examples. + def ca_key() + ENV['CA_KEY'] || nil # The CA private key File + end + + # Client Data. + + # Client file location/directory. Change or specify. + # This is the author's default. + def cli_loc() + ENV['CLI_FLOC'] || "/ad3/gma/sslwork/2013-extended-02" # The client cert location + end + # Client cert file. Change or specify. + # This is the author's default. + def cli_cert() + ENV['CLI_FILE'] || "client.crt" # The client cert File + end + # Client private keyfile. Change or specify. + # This is the author's default. + # This file should not be exposed to the outside world. + def cli_key() + ENV['CLI_KEY'] || nil # The client private key File + end + + # Server Data. + + # Server file location/directory. Change or specify. + # This is the author's default. + # Not currently used in stomp examples. + def svr_loc() + ENV['SVR_FLOC'] || "/ad3/gma/sslwork/2013-extended-02" # The server cert location + end + # Server cert file. Change or specify. + # This is the author's default. + # Not currently used in stomp examples. + def svr_cert() + ENV['SVR_FILE'] || "server.crt" # The server cert File + end + # Server private keyfile. Change or specify. + # This is the author's default. + # This file should not be exposed to the outside world. + # Not currently used in stomp examples. + def svr_key() + ENV['SVR_KEY'] || nil # The server private key File + end + +end + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc1.rb new/examples/ssl_uc1.rb --- old/examples/ssl_uc1.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc1.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,14 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +# +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 1 - server does *not* authenticate client, client does *not* authenticate server # @@ -20,7 +26,7 @@ # class ExampleSSL1 # Initialize. - def initialize + def initialize # Change the following as needed. @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc1_ciphers.rb new/examples/ssl_uc1_ciphers.rb --- old/examples/ssl_uc1_ciphers.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc1_ciphers.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 1 - User Supplied Ciphers # @@ -15,7 +20,9 @@ # class ExampleSSL1C # Initialize. - def initialize + def initialize # Change the following as needed. + @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" + @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end # Run example. def run @@ -27,7 +34,7 @@ # SSL Use Case 1 # hash = { :hosts => [ - {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts}, + {:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts}, ], :reliable => false, # YMMV, to test this in a sane manner } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc2.rb new/examples/ssl_uc2.rb --- old/examples/ssl_uc2.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc2.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 2 - server does *not* authenticate client, client *does* authenticate server # @@ -21,8 +26,7 @@ class ExampleSSL2 # Initialize. def initialize - # Change the following to the location of the cert file(s). - @cert_loc = "/ad3/gma/sslwork/2013" + # Change the following as needed. @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end @@ -32,8 +36,8 @@ ts_flist = [] - # Possibly change the cert file(s) name(s) here. - ts_flist << "#{@cert_loc}/TestCA.crt" + # Possibly change/override the cert data here. + ts_flist << "#{ca_loc()}/#{ca_cert()}" ssl_opts = Stomp::SSLParams.new(:ts_files => ts_flist.join(","), :fsck => true) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc2_ciphers.rb new/examples/ssl_uc2_ciphers.rb --- old/examples/ssl_uc2_ciphers.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc2_ciphers.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 2 - User Supplied Ciphers # @@ -15,7 +20,9 @@ # class ExampleSSL2C # Initialize. - def initialize + def initialize # Change the following as needed. + @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" + @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end # Run example. def run @@ -25,8 +32,8 @@ # ts_flist = [] - # Change the following to the location of your CA's signed certificate. - ts_flist << "/home/gmallard/sslwork/2013/TestCA.crt" + # Possibly change/override the cert data here. + ts_flist << "#{ca_loc()}/#{ca_cert()}" ssl_opts = Stomp::SSLParams.new(:ts_files => ts_flist.join(","), :ciphers => ciphers_list, @@ -34,7 +41,7 @@ ) # hash = { :hosts => [ - {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts}, + {:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts}, ], :reliable => false, # YMMV, to test this in a sane manner } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc3.rb new/examples/ssl_uc3.rb --- old/examples/ssl_uc3.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc3.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 3 - server *does* authenticate client, client does *not* authenticate server # @@ -23,8 +28,7 @@ class ExampleSSL3 # Initialize. def initialize - # Change the following to the location of the cert file(s). - @cert_loc = "/ad3/gma/sslwork/2013" + # Change the following as needed. @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end @@ -34,8 +38,8 @@ # Possibly change the cert file(s) name(s) here. ssl_opts = Stomp::SSLParams.new( - :key_file => "#{@cert_loc}/client.key", # the client's private key - :cert_file => "#{@cert_loc}/client.crt", # the client's signed certificate + :key_file => "#{cli_loc()}/#{pck()}", # the client's private key, private data + :cert_file => "#{cli_loc()}/#{cli_cert()}", # the client's signed certificate :fsck => true # Check that the files exist first ) @@ -53,6 +57,13 @@ # puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}" c.disconnect end + + private + + def pck() + "client.key" + end + end # e = ExampleSSL3.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc3_ciphers.rb new/examples/ssl_uc3_ciphers.rb --- old/examples/ssl_uc3_ciphers.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc3_ciphers.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 3 - User Supplied Ciphers # @@ -15,7 +20,9 @@ # class ExampleSSL3C # Initialize. - def initialize + def initialize # Change the following as needed. + @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" + @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end # Run example. def run @@ -23,18 +30,15 @@ # # SSL Use Case 3 # - # Change the following: - # * location of your client's signed certificate - # * location of tour client's private key. + # Possibly change the cert file(s) name(s) here. ssl_opts = Stomp::SSLParams.new( - :key_file => "/home/gmallard/sslwork/2013/client.key", # the client's private key - :cert_file => "/home/gmallard/sslwork/2013/client.crt", # the client's signed certificate - :fsck => true, # Check that the files exist first - :ciphers => ciphers_list + :key_file => "#{cli_loc()}/#{pck()}", # the client's private key, private data + :cert_file => "#{cli_loc()}/#{cli_cert()}", # the client's signed certificate + :fsck => true # Check that the files exist first ) # hash = { :hosts => [ - {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts}, + {:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts}, ], :reliable => false, # YMMV, to test this in a sane manner } @@ -46,6 +50,13 @@ # puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}" c.disconnect end + + private + + def pck() + "client.key" + end + end # e = ExampleSSL3C.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc4.rb new/examples/ssl_uc4.rb --- old/examples/ssl_uc4.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc4.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 4 - server *does* authenticate client, client *does* authenticate server # @@ -23,8 +28,7 @@ class ExampleSSL4 # Initialize. def initialize - # Change the following to the location of the cert file(s). - @cert_loc = "/ad3/gma/sslwork/2013" + # Change the following as needed. @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end @@ -34,9 +38,9 @@ # Possibly change the cert file(s) name(s) here. ssl_opts = Stomp::SSLParams.new( - :key_file => "#{@cert_loc}/client.key", # The client's private key - :cert_file => "#{@cert_loc}/client.crt", # The client's signed certificate - :ts_files => "#{@cert_loc}/TestCA.crt", # The CA's signed sertificate + :key_file => "#{cli_loc()}/#{pck()}", # the client's private key, private data + :cert_file => "#{cli_loc()}/#{cli_cert()}", # the client's signed certificate + :ts_files => "#{ca_loc()}/#{ca_cert()}", # The CA's signed sertificate :fsck => true # Check that files exist first ) # @@ -53,6 +57,13 @@ # puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}" c.disconnect end + + private + + def pck() + "client.key" + end + end # e = ExampleSSL4.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/examples/ssl_uc4_ciphers.rb new/examples/ssl_uc4_ciphers.rb --- old/examples/ssl_uc4_ciphers.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/examples/ssl_uc4_ciphers.rb 2016-08-22 00:54:57.000000000 +0200 @@ -3,8 +3,13 @@ # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # -require "rubygems" -require "stomp" +if Kernel.respond_to?(:require_relative) + require_relative("./ssl_common") +else + $LOAD_PATH << File.dirname(__FILE__) + require "ssl_common" +end +include SSLCommon # # == SSL Use Case 4 - User Supplied Ciphers # @@ -15,7 +20,9 @@ # class ExampleSSL4C # Initialize. - def initialize + def initialize # Change the following as needed. + @host = ENV['STOMP_HOST'] ? ENV['STOMP_HOST'] : "localhost" + @port = ENV['STOMP_PORT'] ? ENV['STOMP_PORT'].to_i : 61612 end # Run example. def run @@ -23,20 +30,16 @@ # # SSL Use Case 4 # - # Change the following: - # * location of the client's private key - # * location of the client's signed certificate - # * location of the server's CA signed certificate + # Possibly change the cert file(s) name(s) here. ssl_opts = Stomp::SSLParams.new( - :key_file => "/home/gmallard/sslwork/2013/client.key", # The client's private key - :cert_file => "/home/gmallard/sslwork/2013/client.crt", # The client's signed certificate - :ts_files => "/home/gmallard/sslwork/2013/TestCA.crt", # The CA's signed sertificate - :fsck => true, # Check that files exist first - :ciphers => ciphers_list + :key_file => "#{cli_loc()}/#{pck()}", # the client's private key, private data + :cert_file => "#{cli_loc()}/#{cli_cert()}", # the client's signed certificate + :ts_files => "#{ca_loc()}/#{ca_cert()}", # The CA's signed sertificate + :fsck => true # Check that files exist first ) # hash = { :hosts => [ - {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts}, + {:login => 'guest', :passcode => 'guest', :host => @host, :port => @port, :ssl => ssl_opts}, ], :reliable => false, # YMMV, to test this in a sane manner } @@ -48,6 +51,13 @@ # puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}" c.disconnect end + + private + + def pck() + "client.key" + end + end # e = ExampleSSL4C.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/client/utils.rb new/lib/client/utils.rb --- old/lib/client/utils.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/lib/client/utils.rb 2016-08-22 00:54:57.000000000 +0200 @@ -72,10 +72,13 @@ # setting an id in the SUBSCRIPTION header is described in the stomp protocol docs: # http://stomp.github.com/ def set_subscription_id_if_missing(destination, headers) - headers[:id] = headers[:id] ? headers[:id] : headers['id'] - if headers[:id] == nil - headers[:id] = Digest::SHA1.hexdigest(destination) - end + headers[:id] = build_subscription_id(destination, headers) + end + + def build_subscription_id(destination, headers) + return headers[:id] until headers[:id].nil? + return headers['id'] until headers['id'].nil? + Digest::SHA1.hexdigest(destination) end # Parse a stomp URL. @@ -156,7 +159,10 @@ def find_receipt_listener(message) listener = @receipt_listeners[message.headers['receipt-id']] - listener.call(message) if listener + if listener + listener.call(message) + @receipt_listeners.delete(message.headers['receipt-id']) + end end def create_listener_maps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/stomp/client.rb new/lib/stomp/client.rb --- old/lib/stomp/client.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/lib/stomp/client.rb 2016-08-22 00:54:57.000000000 +0200 @@ -118,6 +118,7 @@ Stomp::Error::BrokerException.new(error) end + @receipt_listeners.delete(error.headers['receipt-id']) if error.headers['receipt-id'] client_thread.raise exception end end @@ -173,7 +174,7 @@ # use subscription id to correlate messages to subscription. As described in # the SUBSCRIPTION section of the protocol: http://stomp.github.com/. # If no subscription id is provided, generate one. - set_subscription_id_if_missing(destination, headers) + headers = headers.merge(:id => build_subscription_id(destination, headers)) if @listeners[headers[:id]] raise "attempting to subscribe to a queue with a previous subscription" end @@ -183,7 +184,7 @@ # Unsubscribe from a subscription by name. def unsubscribe(name, headers = {}) - set_subscription_id_if_missing(name, headers) + headers = headers.merge(:id => build_subscription_id(name, headers)) @connection.unsubscribe(name, headers) @listeners[headers[:id]] = nil end @@ -203,7 +204,7 @@ replay_list << message end if block_given? - headers['receipt'] = register_receipt_listener lambda {|r| yield r} + headers = headers.merge(:receipt => register_receipt_listener(lambda {|r| yield r})) end context = ack_context_for(message, headers) @connection.ack context[:message_id], context[:headers] @@ -224,7 +225,7 @@ when Stomp::SPL_12 'ack' when Stomp::SPL_11 - headers.merge!(:subscription => message.headers['subscription']) + headers = headers.merge(:subscription => message.headers['subscription']) 'message-id' else 'message-id' @@ -243,7 +244,7 @@ # Accepts a transaction header ( :transaction => 'some_transaction_id' ). def publish(destination, message, headers = {}) if block_given? - headers['receipt'] = register_receipt_listener lambda {|r| yield r} + headers = headers.merge(:receipt => register_receipt_listener(lambda {|r| yield r})) end @connection.publish(destination, message, headers) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/stomp/connection.rb new/lib/stomp/connection.rb --- old/lib/stomp/connection.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/lib/stomp/connection.rb 2016-08-22 00:54:57.000000000 +0200 @@ -225,32 +225,51 @@ end # Acknowledge a message, used when a subscription has specified - # client acknowledgement i.e. connection.subscribe("/queue/a", :ack => 'client'). - # Accepts an optional transaction header ( :transaction => 'some_transaction_id' ) - # Behavior is protocol level dependent, see the specifications or comments below. - def ack(message_id, headers = {}) + # client acknowledgement e.g.: + # + # connection.subscribe("/queue/a", :ack => 'client') + # + # connection.subscribe("/queue/a", :ack => 'client-individual') + # + # as appropriate for the protocol level. + # + # Accepts an optional transaction header ( :transaction => 'some_transaction_id' ). + # + # When the connection protocol level is 1.0 or 1.1 the message_or_ack_id parameter + # should match the message-id header of the MESSAGE being acknowledged e.g.: + # + # connection.ack(message.headers['message-id']) + # + # When the connection protocol level is 1.2 the message_or_ack_id parameter + # should match the ack header of the MESSAGE being acknowledged e.g.: + # + # connection.ack(message.headers['ack']) + # + # In summary, the behavior is protocol level dependent, see the specifications + # and comments in the code. + def ack(message_or_ack_id, headers = {}) raise Stomp::Error::NoCurrentConnection if @closed_check && closed? raise Stomp::Error::ProtocolErrorEmptyHeaderKey if headers.has_key?("") raise Stomp::Error::ProtocolErrorEmptyHeaderValue if @protocol == Stomp::SPL_10 && headers.has_value?("") - raise Stomp::Error::MessageIDRequiredError if message_id.nil? || message_id == "" + raise Stomp::Error::MessageIDRequiredError if message_or_ack_id.nil? || message_or_ack_id == "" headers = headers.symbolize_keys case @protocol when Stomp::SPL_12 - # The ACK frame MUST include an id header matching the ack header + # The ACK frame MUST include an "id" header matching the "ack" header # of the MESSAGE being acknowledged. - headers[:id] = message_id + headers[:id] = message_or_ack_id when Stomp::SPL_11 - # ACK has two REQUIRED headers: message-id, which MUST contain a value - # matching the message-id for the MESSAGE being acknowledged and - # subscription, which MUST be set to match the value of the subscription's + # ACK has two REQUIRED headers: "message-id", which MUST contain a value + # matching the message-id header of the MESSAGE being acknowledged and + # "subscription", which MUST be set to match the value of SUBSCRIBE's # id header. - headers[:'message-id'] = message_id + headers[:'message-id'] = message_or_ack_id raise Stomp::Error::SubscriptionRequiredError unless headers[:subscription] else # Stomp::SPL_10 - # ACK has one required header, message-id, which must contain a value + # ACK has one required header, "message-id", which must contain a value # matching the message-id for the MESSAGE being acknowledged. - headers[:'message-id'] = message_id + headers[:'message-id'] = message_or_ack_id end _headerCheck(headers) slog(:on_ack, log_params, headers) @@ -258,23 +277,31 @@ end # STOMP 1.1+ NACK. - def nack(message_id, headers = {}) + # + # When the connection protocol level is 1.1 the message_or_ack_id parameter + # should match the message-id header of the MESSAGE being acknowledged. + # + # When the connection protocol level is 1.2 the message_or_ack_id parameter + # should match the ack header of the MESSAGE being acknowledged. + # + # Behavior is protocol level dependent, see the specifications and comments below. + def nack(message_or_ack_id, headers = {}) raise Stomp::Error::NoCurrentConnection if @closed_check && closed? raise Stomp::Error::UnsupportedProtocolError if @protocol == Stomp::SPL_10 raise Stomp::Error::ProtocolErrorEmptyHeaderKey if headers.has_key?("") - raise Stomp::Error::MessageIDRequiredError if message_id.nil? || message_id == "" + raise Stomp::Error::MessageIDRequiredError if message_or_ack_id.nil? || message_or_ack_id == "" headers = headers.symbolize_keys case @protocol when Stomp::SPL_12 # The NACK frame MUST include an id header matching the ack header # of the MESSAGE being acknowledged. - headers[:id] = message_id + headers[:id] = message_or_ack_id else # Stomp::SPL_11 only # NACK has two REQUIRED headers: message-id, which MUST contain a value # matching the message-id for the MESSAGE being acknowledged and # subscription, which MUST be set to match the value of the subscription's # id header. - headers[:'message-id'] = message_id + headers[:'message-id'] = message_or_ack_id raise Stomp::Error::SubscriptionRequiredError unless headers[:subscription] end _headerCheck(headers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/stomp/version.rb new/lib/stomp/version.rb --- old/lib/stomp/version.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/lib/stomp/version.rb 2016-08-22 00:54:57.000000000 +0200 @@ -4,9 +4,10 @@ # Define the gem version. module Version #:nodoc: all - MAJOR = 1 - MINOR = 4 - PATCH = 1 + MAJOR = 1 + MINOR = 4 + PATCH = "3" + # PATCH = "3.plvl.001" STRING = "#{MAJOR}.#{MINOR}.#{PATCH}" end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-06-23 21:27:59.000000000 +0200 +++ new/metadata 2016-08-22 00:54:57.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: stomp version: !ruby/object:Gem::Version - version: 1.4.1 + version: 1.4.3 platform: ruby authors: - Brian McCallister @@ -11,7 +11,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2016-06-23 00:00:00.000000000 Z +date: 2016-08-21 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rspec @@ -20,6 +20,9 @@ - - ">=" - !ruby/object:Gem::Version version: 2.14.1 + - - "~>" + - !ruby/object:Gem::Version + version: '2.14' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement @@ -27,6 +30,9 @@ - - ">=" - !ruby/object:Gem::Version version: 2.14.1 + - - "~>" + - !ruby/object:Gem::Version + version: '2.14' description: Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge. email: @@ -78,6 +84,7 @@ - examples/publisher.rb - examples/put11conn_ex1.rb - examples/putget11_rh1.rb +- examples/ssl_common.rb - examples/ssl_ctxoptions.rb - examples/ssl_newparm.rb - examples/ssl_uc1.rb @@ -117,6 +124,7 @@ - spec/spec_helper.rb - stomp.gemspec - test/.gitignore +- test/funcs.sh - test/test_anonymous.rb - test/test_client.rb - test/test_codec.rb @@ -127,6 +135,7 @@ - test/test_ssl.rb - test/test_urlogin.rb - test/tlogger.rb +- test/unitst.sh homepage: https://github.com/stompgem/stomp licenses: - Apache-2.0 @@ -147,7 +156,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.2.5 +rubygems_version: 2.5.1 signing_key: specification_version: 4 summary: Ruby client for the Stomp messaging protocol diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/client_spec.rb new/spec/client_spec.rb --- old/spec/client_spec.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/spec/client_spec.rb 2016-08-22 00:54:57.000000000 +0200 @@ -402,4 +402,152 @@ end end end + + describe '(used with custom headers)' do + before :each do + @client = Stomp::Client.new + end + + def original_headers + {:custom_header => 'value'} + end + + let(:connection_headers) { original_headers } + let(:headers) { original_headers } + + shared_examples_for 'argument-safe method' do + describe 'given headers hash' do + subject { headers } + it 'is immutable' do + is_expected.to match(original_headers) + end + end + end + + describe '#begin' do + before { + expect(@mock_connection).to receive(:begin).with('name', connection_headers) + @client.begin('name', headers) + } + it_behaves_like 'argument-safe method' + end + + describe '#abort' do + before { + expect(@mock_connection).to receive(:abort).with('name', connection_headers) + @client.abort('name', headers) + } + it_behaves_like 'argument-safe method' + end + + describe '#commit' do + before { + expect(@mock_connection).to receive(:commit).with('name', connection_headers) + @client.commit('name', headers) + } + it_behaves_like 'argument-safe method' + end + + describe '#subscribe' do + let(:connection_headers) { original_headers.merge({:id => Digest::SHA1.hexdigest('destination')}) } + before { + expect(@mock_connection).to receive(:subscribe).with('destination', connection_headers) + @client.subscribe('destination', headers) {|dummy_subscriber| } + } + it_behaves_like 'argument-safe method' + end + + describe '#unsubscribe' do + let(:connection_headers) { original_headers.merge({:id => Digest::SHA1.hexdigest('destination')}) } + before { + expect(@mock_connection).to receive(:unsubscribe).with('destination', connection_headers) + @client.unsubscribe('destination', headers) {|dummy_subscriber| } + } + it_behaves_like 'argument-safe method' + end + + describe '#ack' do + describe 'with STOMP 1.0' do + let(:message) { double('message', :headers => {'message-id' => 'id'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_10) + expect(@mock_connection).to receive(:ack).with('id', connection_headers) + @client.ack(message, headers) + } + it_behaves_like 'argument-safe method' + end + describe 'with STOMP 1.1' do + let(:message) { double('message', :headers => {'message-id' => 'id', 'subscription' => 'subscription_name'}) } + let(:connection_headers) { original_headers.merge({:subscription => 'subscription_name'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_11) + expect(@mock_connection).to receive(:ack).with('id', connection_headers) + @client.ack(message, headers) + } + it_behaves_like 'argument-safe method' + end + describe 'with STOMP 1.2' do + let(:message) { double('message', :headers => {'ack' => 'id'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_12) + expect(@mock_connection).to receive(:ack).with('id', connection_headers) + @client.ack(message, headers) + } + it_behaves_like 'argument-safe method' + end + end + + describe '#nack' do + describe 'with STOMP 1.0' do + let(:message) { double('message', :headers => {'message-id' => 'id'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_10) + expect(@mock_connection).to receive(:nack).with('id', connection_headers) + @client.nack(message, headers) + } + it_behaves_like 'argument-safe method' + end + describe 'with STOMP 1.1' do + let(:message) { double('message', :headers => {'message-id' => 'id', 'subscription' => 'subscription_name'}) } + let(:connection_headers) { original_headers.merge({:subscription => 'subscription_name'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_11) + expect(@mock_connection).to receive(:nack).with('id', connection_headers) + @client.nack(message, headers) + } + it_behaves_like 'argument-safe method' + end + describe 'with STOMP 1.2' do + let(:message) { double('message', :headers => {'ack' => 'id'}) } + before { + allow(@client).to receive(:protocol).and_return(Stomp::SPL_12) + expect(@mock_connection).to receive(:nack).with('id', connection_headers) + @client.nack(message, headers) + } + it_behaves_like 'argument-safe method' + end + end + + describe '#publish' do + describe 'without listener' do + let(:message) { double('message') } + before { + expect(@mock_connection).to receive(:publish).with('destination', message, connection_headers) + @client.publish('destination', message, headers) + } + it_behaves_like 'argument-safe method' + end + describe 'with listener' do + let(:message) { double('message') } + let(:connection_headers) { original_headers.merge({:receipt => 'receipt-uuid'}) } + before { + allow(@client).to receive(:uuid).and_return('receipt-uuid') + expect(@mock_connection).to receive(:publish).with('destination', message, connection_headers) + @client.publish('destination', message, headers) {|dummy_listener| } + } + it_behaves_like 'argument-safe method' + end + end + + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stomp.gemspec new/stomp.gemspec --- old/stomp.gemspec 2016-06-23 21:27:59.000000000 +0200 +++ new/stomp.gemspec 2016-08-22 00:54:57.000000000 +0200 @@ -2,16 +2,16 @@ # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- -# stub: stomp 1.4.1 ruby lib +# stub: stomp 1.4.3 ruby lib Gem::Specification.new do |s| s.name = "stomp" - s.version = "1.4.1" + s.version = "1.4.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Brian McCallister", "Marius Mathiesen", "Thiago Morello", "Guy M. Allard"] - s.date = "2016-06-23" + s.date = "2016-08-21" s.description = "Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge." s.email = ["brianm@apache.org", "marius@stones.com", "morellon@gmail.com", "allard.guy.m@gmail.com"] s.executables = ["catstomp", "stompcat"] @@ -56,6 +56,7 @@ "examples/publisher.rb", "examples/put11conn_ex1.rb", "examples/putget11_rh1.rb", + "examples/ssl_common.rb", "examples/ssl_ctxoptions.rb", "examples/ssl_newparm.rb", "examples/ssl_uc1.rb", @@ -95,6 +96,7 @@ "spec/spec_helper.rb", "stomp.gemspec", "test/.gitignore", + "test/funcs.sh", "test/test_anonymous.rb", "test/test_client.rb", "test/test_codec.rb", @@ -104,23 +106,24 @@ "test/test_message.rb", "test/test_ssl.rb", "test/test_urlogin.rb", - "test/tlogger.rb" + "test/tlogger.rb", + "test/unitst.sh" ] s.homepage = "https://github.com/stompgem/stomp" s.licenses = ["Apache-2.0"] - s.rubygems_version = "2.2.5" + s.rubygems_version = "2.5.1" s.summary = "Ruby client for the Stomp messaging protocol" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_development_dependency(%q<rspec>, [">= 2.14.1"]) + s.add_development_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"]) else - s.add_dependency(%q<rspec>, [">= 2.14.1"]) + s.add_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"]) end else - s.add_dependency(%q<rspec>, [">= 2.14.1"]) + s.add_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"]) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/funcs.sh new/test/funcs.sh --- old/test/funcs.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/test/funcs.sh 2016-08-22 00:54:57.000000000 +0200 @@ -0,0 +1,2 @@ +# ------------------------------------------------------------------------------ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_urlogin.rb new/test/test_urlogin.rb --- old/test/test_urlogin.rb 2016-06-23 21:27:59.000000000 +0200 +++ new/test/test_urlogin.rb 2016-08-22 00:54:57.000000000 +0200 @@ -90,7 +90,7 @@ assert c.open?, url c.close end - end + end if ENV['STOMP_TESTSSL'] # test failover:// with bad parameters def test_0020_failover_badparms() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unitst.sh new/test/unitst.sh --- old/test/unitst.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/test/unitst.sh 2016-08-22 00:54:57.000000000 +0200 @@ -0,0 +1,18 @@ +#!/bin/bash +# +eval $DeBug +# ------------------------------------------------------------------------------ +cmd_base=$(dirname $0) +source $cmd_base/funcs.sh +# ------------------------------------------------------------------------------ +pushd $cmd_base +slist=$(ls -1 *.rb | grep -v helper | grep -v 1method) +for rbf in $slist +do + echo "ruby -I ../lib ${rbf}" + ruby -I ../lib $rbf +done +# ------------------------------------------------------------------------------ +popd +set +x +exit