treequel 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == v1.8.5 [2012-03-07] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Fix an edge-case bug in LDIF-generation logic. Thanks to Mahlon E. Smith
4
+ for the report and the pair to fix it.
5
+
6
+
1
7
  == v1.8.4 [2012-02-02] Michael Granger <ged@FaerieMUD.org>
2
8
 
3
9
  - Fixed a bug with handling of BOOLEAN values in Treequel::Model. Thanks to
@@ -21,20 +21,20 @@ module Treequel
21
21
 
22
22
  ### Define the given +delegated_methods+ as delegators to the like-named method
23
23
  ### of the return value of the +delegate_method+.
24
- ###
24
+ ###
25
25
  ### class MyClass
26
26
  ### extend Treequel::Delegation
27
- ###
27
+ ###
28
28
  ### # Delegate the #bound?, #err, and #result2error methods to the connection
29
29
  ### # object returned by the #connection method. This allows the connection
30
30
  ### # to still be loaded on demand/overridden/etc.
31
31
  ### def_method_delegators :connection, :bound?, :err, :result2error
32
- ###
32
+ ###
33
33
  ### def connection
34
34
  ### @connection ||= self.connect
35
35
  ### end
36
36
  ### end
37
- ###
37
+ ###
38
38
  def def_method_delegators( delegate_method, *delegated_methods )
39
39
  delegated_methods.each do |name|
40
40
  body = make_method_delegator( delegate_method, name )
@@ -46,15 +46,15 @@ module Treequel
46
46
  ### Define the given +delegated_methods+ as delegators to the like-named method
47
47
  ### of the specified +ivar+. This is pretty much identical with how 'Forwardable'
48
48
  ### from the stdlib does delegation, but it's reimplemented here for consistency.
49
- ###
49
+ ###
50
50
  ### class MyClass
51
51
  ### extend Treequel::Delegation
52
- ###
52
+ ###
53
53
  ### # Delegate the #each method to the @collection ivar
54
54
  ### def_ivar_delegators :@collection, :each
55
- ###
55
+ ###
56
56
  ### end
57
- ###
57
+ ###
58
58
  def def_ivar_delegators( ivar, *delegated_methods )
59
59
  delegated_methods.each do |name|
60
60
  body = make_ivar_delegator( ivar, name )
@@ -347,7 +347,7 @@ class Treequel::Model < Treequel::Branch
347
347
  end
348
348
 
349
349
 
350
- ### Validate the object with the specified +options+. Appending validation errors onto
350
+ ### Validate the object with the specified +options+, appending validation errors onto
351
351
  ### the #errors object.
352
352
  def validate( options={} )
353
353
  options = DEFAULT_VALIDATION_OPTIONS.merge( options )
@@ -439,32 +439,29 @@ class Treequel::Model < Treequel::Branch
439
439
  self.log.debug " comparing %s values to entry: %p vs. %p" %
440
440
  [ attribute, values, entry_values ]
441
441
 
442
- # Calculate differences between the values in the directory and the
443
- # values in the model object
444
- new_values = values - entry_values
445
- old_values = entry_values - values
446
-
447
- # If it's not a delete (no values in the mode), but there were values
448
- # removed, it's a REPLACE
449
- if !values.empty? && !old_values.empty?
450
- self.log.debug " REPLACE %s: %p with %p" %
451
- [ attribute, entry_values, values ]
452
- return LDAP::Mod.new( LDAP::LDAP_MOD_REPLACE, attribute, values )
442
+ # If the attributes on the server are the same as the local ones,
443
+ # it's a NOOP.
444
+ if values.sort == entry_values.sort
445
+ self.log.debug " no change."
446
+ return nil
453
447
 
454
- # ...if there were values added to the model, it's an ADD
455
- elsif !new_values.empty?
448
+ # If the directory doesn't have this attribute, but the local
449
+ # object does, it's an ADD
450
+ elsif entry_values.empty?
456
451
  self.log.debug " ADD %s: %p" % [ attribute, values ]
457
- return LDAP::Mod.new( LDAP::LDAP_MOD_ADD, attribute, new_values )
452
+ return LDAP::Mod.new( LDAP::LDAP_MOD_ADD, attribute, values )
458
453
 
459
- # ...or if all the values in the model were removed, it's a DELETE
454
+ # ...or if the local value doesn't have anything for this attribute
455
+ # but the directory does, it's a DEL
460
456
  elsif values.empty?
461
457
  self.log.debug " DELETE %s" % [ attribute ]
462
458
  return LDAP::Mod.new( LDAP::LDAP_MOD_DELETE, attribute )
463
459
 
464
- # otherwise, it's unchanged.
460
+ # ...otherwise it's a REPLACE
465
461
  else
466
- self.log.debug " no change."
467
- return nil
462
+ self.log.debug " REPLACE %s: %p with %p" %
463
+ [ attribute, entry_values, values ]
464
+ return LDAP::Mod.new( LDAP::LDAP_MOD_REPLACE, attribute, values )
468
465
  end
469
466
 
470
467
  end
data/lib/treequel.rb CHANGED
@@ -26,10 +26,10 @@ end
26
26
  module Treequel
27
27
 
28
28
  # Library version
29
- VERSION = '1.8.4'
29
+ VERSION = '1.8.5'
30
30
 
31
31
  # VCS revision
32
- REVISION = %q$Revision: d1834cc0605f $
32
+ REVISION = %q$Revision: 8bdd6d1581e3 $
33
33
 
34
34
  # Common paths for ldap.conf
35
35
  COMMON_LDAP_CONF_PATHS = %w[
@@ -673,6 +673,13 @@ describe Treequel::Model do
673
673
  @obj.should_not be_modified()
674
674
  end
675
675
 
676
+ it "doesn't try to mistakenly delete an attribute that's assigned an empty array " +
677
+ "and isn't set in the directory" do
678
+ @obj.secretary = []
679
+ result = @obj.modifications
680
+ result.should_not include( ldap_mod_delete :secretary )
681
+ end
682
+
676
683
  end
677
684
 
678
685
  it "avoids Arrayifying Time objects when converting them to generalized time strings" do
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.4
4
+ version: 1.8.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,50 +10,38 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain:
13
- - ! '-----BEGIN CERTIFICATE-----
14
-
15
- MIIDLDCCAhSgAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQwwCgYDVQQDDANnZWQx
16
-
17
- FzAVBgoJkiaJk/IsZAEZFgdfYWVyaWVfMRMwEQYKCZImiZPyLGQBGRYDb3JnMB4X
18
-
19
- DTEwMDkxNjE0NDg1MVoXDTExMDkxNjE0NDg1MVowPDEMMAoGA1UEAwwDZ2VkMRcw
20
-
21
- FQYKCZImiZPyLGQBGRYHX2FlcmllXzETMBEGCgmSJomT8ixkARkWA29yZzCCASIw
22
-
23
- DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALy//BFxC1f/cPSnwtJBWoFiFrir
24
-
25
- h7RicI+joq/ocVXQqI4TDWPyF/8tqkvt+rD99X9qs2YeR8CU/YiIpLWrQOYST70J
26
-
27
- vDn7Uvhb2muFVqq6+vobeTkILBEO6pionWDG8jSbo3qKm1RjKJDwg9p4wNKhPuu8
28
-
29
- KGue/BFb67KflqyApPmPeb3Vdd9clspzqeFqp7cUBMEpFS6LWxy4Gk+qvFFJBJLB
30
-
31
- BUHE/LZVJMVzfpC5Uq+QmY7B+FH/QqNndn3tOHgsPadLTNimuB1sCuL1a4z3Pepd
32
-
33
- TeLBEFmEao5Dk3K/Q8o8vlbIB/jBDTUx6Djbgxw77909x6gI9doU4LD5XMcCAwEA
34
-
35
- AaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJeoGkOr9l4B
36
-
37
- +saMkW/ZXT4UeSvVMA0GCSqGSIb3DQEBBQUAA4IBAQBG2KObvYI2eHyyBUJSJ3jN
38
-
39
- vEnU3d60znAXbrSd2qb3r1lY1EPDD3bcy0MggCfGdg3Xu54z21oqyIdk8uGtWBPL
40
-
41
- HIa9EgfFGSUEgvcIvaYqiN4jTUtidfEFw+Ltjs8AP9gWgSIYS6Gr38V0WGFFNzIH
42
-
43
- aOD2wmu9oo/RffW4hS/8GuvfMzcw7CQ355wFR4KB/nyze+EsZ1Y5DerCAagMVuDQ
44
-
45
- U0BLmWDFzPGGWlPeQCrYHCr+AcJz+NRnaHCKLZdSKj/RHuTOt+gblRex8FAh8NeA
46
-
47
- cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
48
-
49
- -----END CERTIFICATE-----
50
-
51
- '
52
- date: 2012-02-02 00:00:00.000000000 Z
13
+ - !binary |-
14
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMRENDQWhTZ0F3SUJB
15
+ Z0lCQURBT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CRzJLT2J2WUkyZUh5eUJVSlNKM2pOCnZF
32
+ blUzZDYwem5BWGJyU2QycWIzcjFsWTFFUEREM2JjeTBNZ2dDZkdkZzNYdTU0
33
+ ejIxb3F5SWRrOHVHdFdCUEwKSElhOUVnZkZHU1VFZ3ZjSXZhWXFpTjRqVFV0
34
+ aWRmRUZ3K0x0anM4QVA5Z1dnU0lZUzZHcjM4VjBXR0ZGTnpJSAphT0Qyd211
35
+ OW9vL1JmZlc0aFMvOEd1dmZNemN3N0NRMzU1d0ZSNEtCL255emUrRXNaMVk1
36
+ RGVyQ0FhZ01WdURRClUwQkxtV0RGelBHR1dsUGVRQ3JZSENyK0FjSnorTlJu
37
+ YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
38
+ Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
39
+ cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
40
+ date: 2012-03-08 00:00:00.000000000 Z
53
41
  dependencies:
54
42
  - !ruby/object:Gem::Dependency
55
43
  name: ruby-ldap
56
- requirement: &70230719754780 !ruby/object:Gem::Requirement
44
+ requirement: &70184430296300 !ruby/object:Gem::Requirement
57
45
  none: false
58
46
  requirements:
59
47
  - - ~>
@@ -61,10 +49,10 @@ dependencies:
61
49
  version: '0.9'
62
50
  type: :runtime
63
51
  prerelease: false
64
- version_requirements: *70230719754780
52
+ version_requirements: *70184430296300
65
53
  - !ruby/object:Gem::Dependency
66
54
  name: hoe-mercurial
67
- requirement: &70230719754360 !ruby/object:Gem::Requirement
55
+ requirement: &70184430295820 !ruby/object:Gem::Requirement
68
56
  none: false
69
57
  requirements:
70
58
  - - ~>
@@ -72,10 +60,10 @@ dependencies:
72
60
  version: 1.3.1
73
61
  type: :development
74
62
  prerelease: false
75
- version_requirements: *70230719754360
63
+ version_requirements: *70184430295820
76
64
  - !ruby/object:Gem::Dependency
77
65
  name: hoe-highline
78
- requirement: &70230719753900 !ruby/object:Gem::Requirement
66
+ requirement: &70184430295340 !ruby/object:Gem::Requirement
79
67
  none: false
80
68
  requirements:
81
69
  - - ~>
@@ -83,10 +71,10 @@ dependencies:
83
71
  version: 0.0.1
84
72
  type: :development
85
73
  prerelease: false
86
- version_requirements: *70230719753900
74
+ version_requirements: *70184430295340
87
75
  - !ruby/object:Gem::Dependency
88
76
  name: rspec
89
- requirement: &70230719753440 !ruby/object:Gem::Requirement
77
+ requirement: &70184430294840 !ruby/object:Gem::Requirement
90
78
  none: false
91
79
  requirements:
92
80
  - - ~>
@@ -94,10 +82,10 @@ dependencies:
94
82
  version: '2.7'
95
83
  type: :development
96
84
  prerelease: false
97
- version_requirements: *70230719753440
85
+ version_requirements: *70184430294840
98
86
  - !ruby/object:Gem::Dependency
99
87
  name: ruby-termios
100
- requirement: &70230719753020 !ruby/object:Gem::Requirement
88
+ requirement: &70184430294400 !ruby/object:Gem::Requirement
101
89
  none: false
102
90
  requirements:
103
91
  - - ~>
@@ -105,10 +93,10 @@ dependencies:
105
93
  version: '0.9'
106
94
  type: :development
107
95
  prerelease: false
108
- version_requirements: *70230719753020
96
+ version_requirements: *70184430294400
109
97
  - !ruby/object:Gem::Dependency
110
98
  name: ruby-terminfo
111
- requirement: &70230719752600 !ruby/object:Gem::Requirement
99
+ requirement: &70184430293960 !ruby/object:Gem::Requirement
112
100
  none: false
113
101
  requirements:
114
102
  - - ~>
@@ -116,10 +104,10 @@ dependencies:
116
104
  version: '0.1'
117
105
  type: :development
118
106
  prerelease: false
119
- version_requirements: *70230719752600
107
+ version_requirements: *70184430293960
120
108
  - !ruby/object:Gem::Dependency
121
109
  name: columnize
122
- requirement: &70230719752180 !ruby/object:Gem::Requirement
110
+ requirement: &70184430293480 !ruby/object:Gem::Requirement
123
111
  none: false
124
112
  requirements:
125
113
  - - ~>
@@ -127,10 +115,10 @@ dependencies:
127
115
  version: '0.3'
128
116
  type: :development
129
117
  prerelease: false
130
- version_requirements: *70230719752180
118
+ version_requirements: *70184430293480
131
119
  - !ruby/object:Gem::Dependency
132
120
  name: sysexits
133
- requirement: &70230719751760 !ruby/object:Gem::Requirement
121
+ requirement: &70184430293040 !ruby/object:Gem::Requirement
134
122
  none: false
135
123
  requirements:
136
124
  - - ~>
@@ -138,10 +126,10 @@ dependencies:
138
126
  version: '1.0'
139
127
  type: :development
140
128
  prerelease: false
141
- version_requirements: *70230719751760
129
+ version_requirements: *70184430293040
142
130
  - !ruby/object:Gem::Dependency
143
131
  name: sequel
144
- requirement: &70230719751340 !ruby/object:Gem::Requirement
132
+ requirement: &70184430292560 !ruby/object:Gem::Requirement
145
133
  none: false
146
134
  requirements:
147
135
  - - ~>
@@ -149,10 +137,10 @@ dependencies:
149
137
  version: '3.20'
150
138
  type: :development
151
139
  prerelease: false
152
- version_requirements: *70230719751340
140
+ version_requirements: *70184430292560
153
141
  - !ruby/object:Gem::Dependency
154
142
  name: rdoc
155
- requirement: &70230719750920 !ruby/object:Gem::Requirement
143
+ requirement: &70184430292100 !ruby/object:Gem::Requirement
156
144
  none: false
157
145
  requirements:
158
146
  - - ~>
@@ -160,10 +148,10 @@ dependencies:
160
148
  version: '3.10'
161
149
  type: :development
162
150
  prerelease: false
163
- version_requirements: *70230719750920
151
+ version_requirements: *70184430292100
164
152
  - !ruby/object:Gem::Dependency
165
153
  name: hoe
166
- requirement: &70230719766880 !ruby/object:Gem::Requirement
154
+ requirement: &70184430291660 !ruby/object:Gem::Requirement
167
155
  none: false
168
156
  requirements:
169
157
  - - ~>
@@ -171,7 +159,7 @@ dependencies:
171
159
  version: '2.13'
172
160
  type: :development
173
161
  prerelease: false
174
- version_requirements: *70230719766880
162
+ version_requirements: *70184430291660
175
163
  description: ! "Treequel is an LDAP toolkit for Ruby. It is intended to allow quick,
176
164
  easy\naccess to LDAP directories in a manner consistent with LDAP's hierarchical,\nfree-form
177
165
  nature. \n\nIt's inspired by and modeled after {Sequel}[http://sequel.rubyforge.org/],
@@ -287,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
275
  version: '0'
288
276
  requirements: []
289
277
  rubyforge_project: treequel
290
- rubygems_version: 1.8.14
278
+ rubygems_version: 1.8.16
291
279
  signing_key:
292
280
  specification_version: 3
293
281
  summary: Treequel is an LDAP toolkit for Ruby
metadata.gz.sig CHANGED
Binary file