Really fixing #modify this time.

Didn't call the right method before, even though the method itself was
fixed properly.
This commit is contained in:
Austin Ziegler 2011-03-25 21:58:24 -04:00
parent d6ad919717
commit 028cdeebbd
4 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,7 @@
=== Net::LDAP 0.2.2 / 2011-03-26
* Bug Fixes:
* Fixed the call to Net::LDAP.modify_ops from Net::LDAP#modify.
=== Net::LDAP 0.2.1 / 2011-03-23 === Net::LDAP 0.2.1 / 2011-03-23
* Bug Fixes: * Bug Fixes:
* Net::LDAP.modify_ops was broken and is now fixed. * Net::LDAP.modify_ops was broken and is now fixed.

View file

@ -106,7 +106,7 @@ module Net # :nodoc:
# <tr><th>BMPString</th><th>C</th><td>30: 62 (0x3e, 0b00111110)</td></tr> # <tr><th>BMPString</th><th>C</th><td>30: 62 (0x3e, 0b00111110)</td></tr>
# </table> # </table>
module BER module BER
VERSION = '0.2.1' VERSION = '0.2.2'
## ##
# Used for BER-encoding the length and content bytes of a Fixnum integer # Used for BER-encoding the length and content bytes of a Fixnum integer

View file

@ -241,7 +241,7 @@ require 'net/ldap/entry'
# and then keeps it open while it executes a user-supplied block. # and then keeps it open while it executes a user-supplied block.
# Net::LDAP#open closes the connection on completion of the block. # Net::LDAP#open closes the connection on completion of the block.
class Net::LDAP class Net::LDAP
VERSION = "0.2.1" VERSION = "0.2.2"
class LdapError < StandardError; end class LdapError < StandardError; end
@ -1459,7 +1459,7 @@ class Net::LDAP::Connection #:nodoc:
} }
def self.modify_ops(operations) def self.modify_ops(operations)
modify_ops = [] ops = []
if operations if operations
operations.each { |op, attrib, values| operations.each { |op, attrib, values|
# TODO, fix the following line, which gives a bogus error if the # TODO, fix the following line, which gives a bogus error if the
@ -1467,10 +1467,10 @@ class Net::LDAP::Connection #:nodoc:
op_ber = MODIFY_OPERATIONS[op.to_sym].to_ber_enumerated op_ber = MODIFY_OPERATIONS[op.to_sym].to_ber_enumerated
values = [ values ].flatten.map { |v| v.to_ber if v }.to_ber_set values = [ values ].flatten.map { |v| v.to_ber if v }.to_ber_set
values = [ attrib.to_s.to_ber, values ].to_ber_sequence values = [ attrib.to_s.to_ber, values ].to_ber_sequence
modify_ops << [ op_ber, values ].to_ber ops << [ op_ber, values ].to_ber
} }
end end
modify_ops ops
end end
#-- #--
@ -1482,9 +1482,9 @@ class Net::LDAP::Connection #:nodoc:
#++ #++
def modify(args) def modify(args)
modify_dn = args[:dn] or raise "Unable to modify empty DN" modify_dn = args[:dn] or raise "Unable to modify empty DN"
modify_ops = modify_ops args[:operations] ops = self.class.modify_ops args[:operations]
request = [ modify_dn.to_ber, request = [ modify_dn.to_ber,
modify_ops.to_ber_sequence ].to_ber_appsequence(6) ops.to_ber_sequence ].to_ber_appsequence(6)
pkt = [ next_msgid.to_ber, request ].to_ber_sequence pkt = [ next_msgid.to_ber, request ].to_ber_sequence
@conn.write pkt @conn.write pkt

View file

@ -2,7 +2,7 @@
# :stopdoc: # :stopdoc:
module Net module Net
class SNMP class SNMP
VERSION = '0.2.1' VERSION = '0.2.2'
AsnSyntax = Net::BER.compile_syntax({ AsnSyntax = Net::BER.compile_syntax({
:application => { :application => {