Skip to content

Commit d1a0a41

Browse files
author
emiel
committed
Do not rely on obsolete Object#to_a behaviour.
* Fix for RubyForge Bug #20054 (Patch submitted by Jos Backus) git-svn-id: http://net-ldap.rubyforge.org/svn/trunk@283 005445c4-6811-0410-8301-cae4f0071d1d
1 parent f5ebff2 commit d1a0a41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/net/ldap.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ def modify args
15331533
# TODO, fix the following line, which gives a bogus error
15341534
# if the opcode is invalid.
15351535
op_1 = {:add => 0, :delete => 1, :replace => 2} [op.to_sym].to_ber_enumerated
1536-
modify_ops << [op_1, [attr.to_s.to_ber, values.to_a.map {|v| v.to_ber}.to_ber_set].to_ber_sequence].to_ber_sequence
1536+
modify_ops << [op_1, [attr.to_s.to_ber, [*values].map {|v| v.to_ber}.to_ber_set].to_ber_sequence].to_ber_sequence
15371537
}
15381538

15391539
request = [modify_dn.to_ber, modify_ops.to_ber_sequence].to_ber_appsequence(6)
@@ -1557,7 +1557,7 @@ def add args
15571557
add_dn = args[:dn] or raise LdapError.new("Unable to add empty DN")
15581558
add_attrs = []
15591559
a = args[:attributes] and a.each {|k,v|
1560-
add_attrs << [ k.to_s.to_ber, v.to_a.map {|m| m.to_ber}.to_ber_set ].to_ber_sequence
1560+
add_attrs << [ k.to_s.to_ber, [*v].map {|m| m.to_ber}.to_ber_set ].to_ber_sequence
15611561
}
15621562

15631563
request = [add_dn.to_ber, add_attrs.to_ber_sequence].to_ber_appsequence(8)

0 commit comments

Comments
 (0)