ruby-activeldap-debug 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/activeldap.rb CHANGED
@@ -907,7 +907,7 @@ require 'activeldap/configuration'
907
907
  require 'activeldap/schema2'
908
908
 
909
909
  module ActiveLDAP
910
- VERSION = "0.5.6"
910
+ VERSION = "0.5.7"
911
911
  end
912
912
 
913
913
  ActiveLDAP::Base.class_eval do
@@ -497,9 +497,7 @@ module ActiveLDAP
497
497
  end
498
498
 
499
499
  @data = {} # where the r/w entry data is stored
500
- @data.default = []
501
500
  @ldap_data = {} # original ldap entry data
502
- @ldap_data.default = []
503
501
  @attr_methods = {} # list of valid method calls for attributes used for dereferencing
504
502
 
505
503
  # Break val apart if it is a dn
@@ -624,7 +622,10 @@ module ActiveLDAP
624
622
  @data['objectClass'].each do |objc|
625
623
  @must.each do |req_attr|
626
624
  deref = @attr_methods[req_attr]
627
- if @data[deref] == []
625
+ # Set default if it wasn't yet set.
626
+ @data[deref] = [] if @data[deref].nil?
627
+ # Check for missing requirements.
628
+ if @data[deref].empty?
628
629
  raise AttributeEmpty,
629
630
  "objectClass '#{objc}' requires attribute '#{Base.schema.attribute_aliases(req_attr).join(', ')}'"
630
631
  end
@@ -867,9 +868,7 @@ module ActiveLDAP
867
868
  end
868
869
 
869
870
  @data = {} # where the r/w entry data is stored
870
- @data.default = []
871
871
  @ldap_data = {} # original ldap entry data
872
- @ldap_data.default = []
873
872
  @attr_methods = {} # list of valid method calls for attributes used for dereferencing
874
873
 
875
874
  # Get some attributes
@@ -1165,6 +1164,9 @@ module ActiveLDAP
1165
1164
  @@logger.debug("stub: called attribute_method(#{method.inspect}, #{not_array.inspect}")
1166
1165
  attr = @attr_methods[method]
1167
1166
 
1167
+ # Set the default value to empty if attr is not set.
1168
+ @data[attr] = [] if @data[attr].nil?
1169
+
1168
1170
  # Return a copy of the stored data
1169
1171
  return array_of(@data[attr].dup, false) if not_array
1170
1172
  return @data[attr]
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: ruby-activeldap-debug
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.6
7
- date: 2005-05-06
6
+ version: 0.5.7
7
+ date: 2005-05-24
8
8
  summary: Ruby/ActiveLDAP is a object-oriented API to LDAP
9
9
  require_paths:
10
10
  - lib