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 20
20
21
21
# Extend the standard ruby {URI} with AMQP and AMQPS schemes
22
22
module 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
+
23
30
# AMQP URI scheme for the AMQP protocol
24
31
class AMQP < Generic
25
32
DEFAULT_PORT = 5672
26
33
27
34
# @return [String] The AMQP address is the {#path} stripped of any leading "/"
28
35
def amqp_address ( ) path [ 0 ] == "/" ? path [ 1 ..-1 ] : path ; end
29
36
end
30
- scheme_list [ 'AMQP' ] = AMQP
37
+ register_scheme 'AMQP' , AMQP
31
38
32
39
# AMQPS URI scheme for the AMQP protocol over TLS
33
40
class AMQPS < AMQP
34
41
DEFAULT_PORT = 5671
35
42
end
36
- scheme_list [ 'AMQPS' ] = AMQPS
43
+ register_scheme 'AMQPS' , AMQPS
37
44
end
38
45
39
46
module Qpid ::Proton
You can’t perform that action at this time.
0 commit comments