Skip to content

Commit 2237970

Browse files
Explain why we are using unpack
1 parent 286ace6 commit 2237970

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/net/ldap/dataset.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def read_ldif(io)
139139
elsif line =~ /^dn:([\:]?)[\s]*/i
140140
# $1 is a colon if the dn-value is base-64 encoded
141141
# $' is the dn-value
142+
# Avoid the Base64 class because not all Ruby versions have it.
142143
dn = ($1 == ":") ? $'.unpack('m').shift : $'
143144
ds[dn] = Hash.new { |k,v| k[v] = [] }
144145
yield :dn, dn if block_given?

0 commit comments

Comments
 (0)