@@ -547,19 +547,19 @@ def self.result2string(code) #:nodoc:
547
547
def initialize ( args = { } )
548
548
# URI.parse('') returns a valid URI object, but with all its
549
549
# attributes set to nil. This is convenient for chained '||'
550
- @uri = URI . parse ( args [ :uri ] || '' )
550
+ @url = URI . parse ( args [ :uri ] || '' )
551
551
552
- unless [ nil , 'ldaps' , 'ldap' ] . include? @uri . scheme
552
+ unless [ nil , 'ldaps' , 'ldap' ] . include? @url . scheme
553
553
raise ProtocolNotSupported ,
554
- "scheme '#{ @uri . scheme } ' unsupported, use 'ldap' or 'ldaps'"
554
+ "scheme '#{ @url . scheme } ' unsupported, use 'ldap' or 'ldaps'"
555
555
end
556
- @host = args [ :host ] || @uri . host || DefaultHost
557
- @port = args [ :port ] || @uri . port || DefaultPort
556
+ @host = args [ :host ] || @url . host || DefaultHost
557
+ @port = args [ :port ] || @url . port || DefaultPort
558
558
@hosts = args [ :hosts ]
559
559
@verbose = false # Make this configurable with a switch on the class.
560
560
@auth = args [ :auth ] || DefaultAuth
561
- @base = args [ :base ] || if @uri . path && @uri . path . length > 1
562
- URI . decode ( @uri . path [ 1 ..-1 ] )
561
+ @base = args [ :base ] || if @url . path && @url . path . length > 1
562
+ URI . decode ( @url . path [ 1 ..-1 ] )
563
563
else
564
564
DefaultTreebase
565
565
end
@@ -1348,7 +1348,7 @@ def normalize_encryption(args)
1348
1348
"encryption may be hash, nil, or one of [:simple_tls, :start_tls, true]"
1349
1349
1350
1350
if args . nil?
1351
- return nil unless @uri . scheme == 'ldaps'
1351
+ return nil unless @url . scheme == 'ldaps'
1352
1352
{ method : :simple_tls ,
1353
1353
tls_options : OpenSSL ::SSL ::SSLContext ::DEFAULT_PARAMS }
1354
1354
elsif args . is_a? Hash
@@ -1359,7 +1359,7 @@ def normalize_encryption(args)
1359
1359
{ method : method ,
1360
1360
tls_options : { } }
1361
1361
when :true
1362
- scheme = if @uri . scheme == 'ldaps' || @port == DefaultTlsPort
1362
+ scheme = if @url . scheme == 'ldaps' || @port == DefaultTlsPort
1363
1363
:simple_tls
1364
1364
else
1365
1365
:start_tls
0 commit comments