lib/activeldap/ldap.rb in ruby-activeldap-debug-0.7.2 vs lib/activeldap/ldap.rb in ruby-activeldap-debug-0.7.3

- old
+ new

@@ -1,12 +1,12 @@ # Extensions to Rubu/LDAP to make ActiveLDAP behave better # # Copyright 2006 Will Drewry <will@alum.bu.edu> # Some portions Copyright 2006 Google Inc +require 'ldap' - module LDAP class PrettyError < RuntimeError end ERRORS = [ @@ -66,11 +66,11 @@ ] attr_reader :error_map # Calls err2exception() with 1...100 to # pregenerate all the constants for errors. # TODO: look at other support LDAP SDKs for weirdness - def LDAP::generate_err2exceptions() + def LDAP.generate_err2exceptions() hash = {} ERRORS.each do |err| begin val = LDAP.const_get(err) # Make name into a exception @@ -103,9 +103,11 @@ end exc = RuntimeError end return [exc, err2string(errno)] end + + end -# Generate! +# Generate LDAP constants LDAP::generate_err2exceptions()