File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2020
2121# Extend the standard ruby {URI} with AMQP and AMQPS schemes
2222module URI
23+ # monkey patch register_scheme for earlier versions of ruby
24+ if !self . respond_to? :register_scheme
25+ def self . register_scheme ( scheme , klass )
26+ @@schemes [ scheme ] = klass
27+ end
28+ end
29+
2330 # AMQP URI scheme for the AMQP protocol
2431 class AMQP < Generic
2532 DEFAULT_PORT = 5672
2633
2734 # @return [String] The AMQP address is the {#path} stripped of any leading "/"
2835 def amqp_address ( ) path [ 0 ] == "/" ? path [ 1 ..-1 ] : path ; end
2936 end
30- scheme_list [ 'AMQP' ] = AMQP
37+ register_scheme 'AMQP' , AMQP
3138
3239 # AMQPS URI scheme for the AMQP protocol over TLS
3340 class AMQPS < AMQP
3441 DEFAULT_PORT = 5671
3542 end
36- scheme_list [ 'AMQPS' ] = AMQPS
43+ register_scheme 'AMQPS' , AMQPS
3744end
3845
3946module Qpid ::Proton
You can’t perform that action at this time.
0 commit comments