Skip to content

Commit

Permalink
Really fixing #modify this time.
Browse files Browse the repository at this point in the history
Didn't call the right method before, even though the method itself was
fixed properly.
  • Loading branch information
Austin Ziegler committed Mar 26, 2011
1 parent d6ad919 commit 028cdee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions History.rdoc
@@ -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
* Bug Fixes:
* Net::LDAP.modify_ops was broken and is now fixed.
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ber.rb
Expand Up @@ -106,7 +106,7 @@ module Net # :nodoc:
# <tr><th>BMPString</th><th>C</th><td>30: 62 (0x3e, 0b00111110)</td></tr>
# </table>
module BER
VERSION = '0.2.1'
VERSION = '0.2.2'

##
# Used for BER-encoding the length and content bytes of a Fixnum integer
Expand Down
12 changes: 6 additions & 6 deletions lib/net/ldap.rb
Expand Up @@ -241,7 +241,7 @@ class LDAP
# and then keeps it open while it executes a user-supplied block.
# Net::LDAP#open closes the connection on completion of the block.
class Net::LDAP
VERSION = "0.2.1"
VERSION = "0.2.2"

class LdapError < StandardError; end

Expand Down Expand Up @@ -1459,18 +1459,18 @@ def search(args = {})
}

def self.modify_ops(operations)
modify_ops = []
ops = []
if operations
operations.each { |op, attrib, values|
# TODO, fix the following line, which gives a bogus error if the
# opcode is invalid.
op_ber = MODIFY_OPERATIONS[op.to_sym].to_ber_enumerated
values = [ values ].flatten.map { |v| v.to_ber if v }.to_ber_set
values = [ attrib.to_s.to_ber, values ].to_ber_sequence
modify_ops << [ op_ber, values ].to_ber
ops << [ op_ber, values ].to_ber
}
end
modify_ops
ops
end

#--
Expand All @@ -1482,9 +1482,9 @@ def self.modify_ops(operations)
#++
def modify(args)
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,
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
@conn.write pkt

Expand Down
2 changes: 1 addition & 1 deletion lib/net/snmp.rb
Expand Up @@ -2,7 +2,7 @@
# :stopdoc:
module Net
class SNMP
VERSION = '0.2.1'
VERSION = '0.2.2'

AsnSyntax = Net::BER.compile_syntax({
:application => {
Expand Down

0 comments on commit 028cdee

Please sign in to comment.