treequel 1.8.5 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/ChangeLog +82 -5
- data/History.rdoc +7 -0
- data/Manifest.txt +1 -0
- data/Rakefile +2 -1
- data/examples/company-directory.rb +9 -10
- data/examples/webroot/css/master.css +379 -0
- data/lib/treequel.rb +2 -2
- data/lib/treequel/constants.rb +2 -2
- data/lib/treequel/directory.rb +13 -6
- data/spec/lib/helpers.rb +12 -3
- data/spec/treequel/directory_spec.rb +6 -1
- data/spec/treequel/filter_spec.rb +5 -9
- data/spec/treequel/mixins_spec.rb +2 -2
- metadata +28 -27
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,12 +1,79 @@
|
|
1
|
-
2012-
|
1
|
+
2012-03-20 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* experiments/spec-profile-r408f5fadc4c5.graffle:
|
4
|
+
Add spec profile
|
5
|
+
[654ba9e47642] [github/master, tip]
|
6
|
+
|
7
|
+
* .hgignore, Manifest.txt, Rakefile, lib/treequel/constants.rb,
|
8
|
+
lib/treequel/directory.rb, spec/lib/helpers.rb,
|
9
|
+
spec/treequel/directory_spec.rb, spec/treequel/filter_spec.rb,
|
10
|
+
spec/treequel/mixins_spec.rb:
|
11
|
+
Ensure directory strings are UTF-8 if they can be. (fixes #15)
|
12
|
+
[408f5fadc4c5]
|
13
|
+
|
14
|
+
2012-03-14 Michael Granger <ged@FaerieMUD.org>
|
15
|
+
|
16
|
+
* examples/company-directory.rb, examples/webroot/css/master.css:
|
17
|
+
Updating the Company Directory example (fixes gh-4)
|
18
|
+
[36c332c3d255]
|
19
|
+
|
20
|
+
2012-03-07 Michael Granger <ged@FaerieMUD.org>
|
2
21
|
|
3
22
|
* .hgtags:
|
4
|
-
Added tag v1.8.
|
5
|
-
[
|
23
|
+
Added tag v1.8.5 for changeset 49755112de40
|
24
|
+
[dc863bba3f36]
|
6
25
|
|
7
26
|
* .hgsigs:
|
8
|
-
Added signature for changeset
|
9
|
-
[
|
27
|
+
Added signature for changeset 8bdd6d1581e3
|
28
|
+
[49755112de40] [v1.8.5]
|
29
|
+
|
30
|
+
* History.rdoc, lib/treequel.rb:
|
31
|
+
Bump the patch version, update history.
|
32
|
+
[8bdd6d1581e3]
|
33
|
+
|
34
|
+
* lib/treequel/model.rb, spec/treequel/model_spec.rb:
|
35
|
+
Fix an edge-case bug in the LDIF-generation logic.
|
36
|
+
|
37
|
+
Thanks to Mahlon E. Smith for pointing out the problem and pairing
|
38
|
+
with me to fix it.
|
39
|
+
[800c5704d3d0]
|
40
|
+
|
41
|
+
* lib/treequel/mixins.rb, lib/treequel/model.rb:
|
42
|
+
Clean up whitespace and fix grammar
|
43
|
+
[d2535e66cafb]
|
44
|
+
|
45
|
+
* .rvmrc:
|
46
|
+
Remove patchlevel from the rvmrc version
|
47
|
+
[38c23fd400ed]
|
48
|
+
|
49
|
+
2012-02-02 Michael Granger <ged@FaerieMUD.org>
|
50
|
+
|
51
|
+
* .hgtags:
|
52
|
+
Added tag v1.8.4 for changeset 4cff12d629e6
|
53
|
+
[600bcf4a8ac9]
|
54
|
+
|
55
|
+
* .hgsigs:
|
56
|
+
Added signature for changeset d1834cc0605f
|
57
|
+
[4cff12d629e6] [v1.8.4]
|
58
|
+
|
59
|
+
* History.rdoc, lib/treequel.rb:
|
60
|
+
Bump the patch version, update history.
|
61
|
+
[d1834cc0605f]
|
62
|
+
|
63
|
+
* Merged with 142d9a553024
|
64
|
+
[471e65c7dd19]
|
65
|
+
|
66
|
+
* lib/treequel/model.rb, lib/treequel/model/schemavalidations.rb,
|
67
|
+
spec/treequel/model_spec.rb:
|
68
|
+
Fix incorrect handling of boolean values set to 'false' (fixes
|
69
|
+
gh-3).
|
70
|
+
|
71
|
+
Thanks to Patricio Bruna for reporting this.
|
72
|
+
[da0b01bdb42f]
|
73
|
+
|
74
|
+
* lib/treequel/model.rb, spec/treequel/model_spec.rb:
|
75
|
+
Whitespace cleanup.
|
76
|
+
[de64de3dad50]
|
10
77
|
|
11
78
|
2012-01-27 Michael Granger <ged@FaerieMUD.org>
|
12
79
|
|
@@ -20,6 +87,16 @@
|
|
20
87
|
Fixing a link in the README
|
21
88
|
[55b0f2e1048e]
|
22
89
|
|
90
|
+
2012-01-30 Michael Granger <ged@FaerieMUD.org>
|
91
|
+
|
92
|
+
* .hgtags:
|
93
|
+
Added tag v1.8.3 for changeset c9e91880eeb9
|
94
|
+
[142d9a553024]
|
95
|
+
|
96
|
+
* .hgsigs:
|
97
|
+
Added signature for changeset 5bab245f02aa
|
98
|
+
[c9e91880eeb9] [v1.8.3]
|
99
|
+
|
23
100
|
2012-01-25 Michael Granger <ged@FaerieMUD.org>
|
24
101
|
|
25
102
|
* lib/treequel/monkeypatches.rb:
|
data/History.rdoc
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== v1.8.6 [2012-03-20] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
- Fix encoding of directory strings under Ruby 1.9 and newer versions
|
4
|
+
of Ruby-LDAP.
|
5
|
+
- Update the examples.
|
6
|
+
|
7
|
+
|
1
8
|
== v1.8.5 [2012-03-07] Michael Granger <ged@FaerieMUD.org>
|
2
9
|
|
3
10
|
- Fix an edge-case bug in LDIF-generation logic. Thanks to Mahlon E. Smith
|
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -11,6 +11,7 @@ require 'rake/clean'
|
|
11
11
|
Hoe.plugin :mercurial
|
12
12
|
Hoe.plugin :signing
|
13
13
|
Hoe.plugin :manualgen
|
14
|
+
Hoe.plugin :deveiate
|
14
15
|
|
15
16
|
Hoe.plugins.delete :rubyforge
|
16
17
|
|
@@ -30,7 +31,7 @@ hoespec = Hoe.spec 'treequel' do
|
|
30
31
|
else
|
31
32
|
self.dependency 'ruby-ldap', '~> 0.9'
|
32
33
|
end
|
33
|
-
self.dependency 'rspec', '~> 2.
|
34
|
+
self.dependency 'rspec', '~> 2.8', :developer
|
34
35
|
self.dependency 'ruby-termios', '~> 0.9', :developer
|
35
36
|
self.dependency 'ruby-terminfo', '~> 0.1', :developer
|
36
37
|
self.dependency 'columnize', '~> 0.3', :developer
|
@@ -7,16 +7,16 @@ require 'pathname'
|
|
7
7
|
|
8
8
|
# A barebones web-based company directory
|
9
9
|
|
10
|
-
LDAP_URL = "ldap://ldap.yourcompany.com/dc=yourcompany,dc=com"
|
11
|
-
|
12
10
|
configure do
|
13
|
-
#
|
14
|
-
set :
|
11
|
+
# Load CSS and stuff from the webroot/ directory
|
12
|
+
set :public_folder, Pathname( __FILE__ ).dirname + 'webroot'
|
13
|
+
|
14
|
+
enable :logging, :dump_errors
|
15
15
|
end
|
16
16
|
|
17
17
|
before do
|
18
|
-
|
19
|
-
|
18
|
+
@ldap ||= Treequel.directory_from_config
|
19
|
+
$stderr.puts "Using directory: %p" % [ @ldap ]
|
20
20
|
end
|
21
21
|
|
22
22
|
|
@@ -93,8 +93,8 @@ __END__
|
|
93
93
|
<% people.each_with_index do |person, i| %>
|
94
94
|
<% rowclass = i.divmod(2).last.zero? ? "even" : "odd" %>
|
95
95
|
<tr class="<%= rowclass %>">
|
96
|
-
<td class="odd"><a href="/<%= person[:uid] %>"><%= person[:cn] %></p></td>
|
97
|
-
<td class="even"><a href="/<%= person[:uid] %>"><%= person[:mail] %></a></td>
|
96
|
+
<td class="odd"><a href="/<%= person[:uid].first %>"><%= person[:cn].first %></p></td>
|
97
|
+
<td class="even"><a href="/<%= person[:uid].first %>"><%= person[:mail].first %></a></td>
|
98
98
|
<td class="odd"><%= person[:employeeNumber] %></td>
|
99
99
|
</tr>
|
100
100
|
<% end %>
|
@@ -103,8 +103,7 @@ __END__
|
|
103
103
|
|
104
104
|
@@details
|
105
105
|
|
106
|
-
<h2>Details for <%= person[:cn] %>
|
107
|
-
<<%= person[:mail] %>></h2>
|
106
|
+
<h2>Details for <%= person[:cn].first %> <<%= person[:mail].first %>></h2>
|
108
107
|
|
109
108
|
<pre>
|
110
109
|
<%= person.to_ldif %>
|
@@ -0,0 +1,379 @@
|
|
1
|
+
/* @override
|
2
|
+
http://localhost:9393/css/master.css
|
3
|
+
*/
|
4
|
+
|
5
|
+
/*
|
6
|
+
* Treequel Examples Stylesheet
|
7
|
+
*
|
8
|
+
* Authors:
|
9
|
+
* * Michael Granger <mgranger@laika.com>
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
|
13
|
+
/* @group Entity styles */
|
14
|
+
html {
|
15
|
+
font: 14px/1.4em "Helvetica Neue", Verdana, sans-serif;
|
16
|
+
margin: 0;
|
17
|
+
padding: 0;
|
18
|
+
text-align: left;
|
19
|
+
line-height: 1.5em;
|
20
|
+
border-left: 2px solid #908558;
|
21
|
+
min-height: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
body {
|
25
|
+
margin: 0;
|
26
|
+
min-width: 620px;
|
27
|
+
background: #eee;
|
28
|
+
}
|
29
|
+
|
30
|
+
h1,h2,h3,h4,h5,h6 {
|
31
|
+
margin-top: 1em;
|
32
|
+
margin-bottom: 0;
|
33
|
+
color: #333;
|
34
|
+
font-weight: bold;
|
35
|
+
}
|
36
|
+
|
37
|
+
h1 {
|
38
|
+
font-family: "Helvetica Neue UltraLight", sans-serif;
|
39
|
+
font-size: 340%;
|
40
|
+
text-shadow: 1px 1px 2px #666;
|
41
|
+
padding-bottom: 0.25em;
|
42
|
+
border-bottom: 1px solid;
|
43
|
+
margin-top: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
h2 {
|
47
|
+
font-family: "Helvetica Neue Condensed Bold", Verdana, sans-serif;
|
48
|
+
font-size: 180%;
|
49
|
+
}
|
50
|
+
|
51
|
+
h3 {
|
52
|
+
font-size: 120%;
|
53
|
+
border-left: 1em solid;
|
54
|
+
padding-left: 0.5em;
|
55
|
+
}
|
56
|
+
|
57
|
+
h4 {
|
58
|
+
font-size: 110%;
|
59
|
+
}
|
60
|
+
|
61
|
+
h5 {
|
62
|
+
font-variant: small-caps;
|
63
|
+
}
|
64
|
+
|
65
|
+
h6 {
|
66
|
+
font-style: italic;
|
67
|
+
}
|
68
|
+
|
69
|
+
input, textarea, button, select {
|
70
|
+
font: 12px/1.2em "Helvetica Neue Condensed Bold", Verdana, sans-serif;
|
71
|
+
padding: 1px;
|
72
|
+
border: 1px solid #CDCABD;
|
73
|
+
background: #E5E1D2;
|
74
|
+
color: #3a3a2b;
|
75
|
+
}
|
76
|
+
textarea {
|
77
|
+
width: 100%;
|
78
|
+
}
|
79
|
+
textarea.code {
|
80
|
+
font: 12px/1.2em "Vera Sans Mono", monospace;
|
81
|
+
}
|
82
|
+
|
83
|
+
input:focus, textarea:focus, select:focus, button:focus {
|
84
|
+
background: #AED5E3;
|
85
|
+
border: 1px solid #6894B4;
|
86
|
+
}
|
87
|
+
|
88
|
+
input[type=submit], input[type=reset], button {
|
89
|
+
cursor: pointer;
|
90
|
+
}
|
91
|
+
|
92
|
+
input[type=submit]:hover, input[type=reset]:hover, button:hover {
|
93
|
+
|
94
|
+
}
|
95
|
+
|
96
|
+
button {
|
97
|
+
font-size: 1.1em;
|
98
|
+
padding: 0.2em 1em;
|
99
|
+
-webkit-border-radius: 5px;
|
100
|
+
-moz-border-radius: 5px;
|
101
|
+
border-color: #918474;
|
102
|
+
-webkit-box-shadow: 1px 1px 2px rgba(35,35,35,0.4);
|
103
|
+
-moz-box-shadow: 1px 1px 2px #333;
|
104
|
+
}
|
105
|
+
|
106
|
+
form {
|
107
|
+
margin: 0 auto;
|
108
|
+
background: #FAF8F1;
|
109
|
+
border: none;
|
110
|
+
padding: 0.4em 1em;
|
111
|
+
-webkit-border-radius: 5px;
|
112
|
+
-moz-border-radius: 5px;
|
113
|
+
-webkit-box-shadow: 1px 1px 5px rgba(55,55,55,0.4);
|
114
|
+
-moz-box-shadow: 1px 1px 5px 2px #999;
|
115
|
+
}
|
116
|
+
|
117
|
+
fieldset {
|
118
|
+
margin: 0.2em auto;
|
119
|
+
border: none;
|
120
|
+
}
|
121
|
+
|
122
|
+
legend {
|
123
|
+
font-weight: bold;
|
124
|
+
color: #616253;
|
125
|
+
font-size: 140%;
|
126
|
+
}
|
127
|
+
|
128
|
+
fieldset.nodisplay {
|
129
|
+
border: 0;
|
130
|
+
margin: 0;
|
131
|
+
background: inherit;
|
132
|
+
-webkit-box-shadow: none;
|
133
|
+
-moz-box-shadow: none;
|
134
|
+
}
|
135
|
+
|
136
|
+
fieldset.nodisplay legend {
|
137
|
+
display: none;
|
138
|
+
}
|
139
|
+
|
140
|
+
a {
|
141
|
+
color: #3f6217;
|
142
|
+
font-weight: bold;
|
143
|
+
text-decoration: none;
|
144
|
+
border-bottom: 1px dotted;
|
145
|
+
}
|
146
|
+
|
147
|
+
th a {
|
148
|
+
color: inherit;
|
149
|
+
}
|
150
|
+
|
151
|
+
a:visited {
|
152
|
+
color: #3a3a2b;
|
153
|
+
}
|
154
|
+
|
155
|
+
a:hover {
|
156
|
+
border-bottom: 1px solid;
|
157
|
+
}
|
158
|
+
|
159
|
+
a:hover img {
|
160
|
+
border: 0;
|
161
|
+
}
|
162
|
+
|
163
|
+
ul {
|
164
|
+
padding-left: 25px;
|
165
|
+
}
|
166
|
+
|
167
|
+
ul li {
|
168
|
+
padding-left: 0;
|
169
|
+
margin-left: 0;
|
170
|
+
}
|
171
|
+
|
172
|
+
img {
|
173
|
+
border: 0;
|
174
|
+
}
|
175
|
+
|
176
|
+
table caption {
|
177
|
+
margin: 15px 5px 0;
|
178
|
+
font-size: 10px;
|
179
|
+
padding: 5px 0 2px;
|
180
|
+
}
|
181
|
+
|
182
|
+
|
183
|
+
.albumInfo {
|
184
|
+
height: 8em;
|
185
|
+
padding: 1em;
|
186
|
+
border-top: 1px solid #858585;
|
187
|
+
border-bottom: 1px solid #505050;
|
188
|
+
}
|
189
|
+
|
190
|
+
.albumInfo h1 {
|
191
|
+
font-weight: bold;
|
192
|
+
text-shadow: 0px -1px 1px black;
|
193
|
+
font-size: 1.2em;
|
194
|
+
}
|
195
|
+
|
196
|
+
ul.tracks {
|
197
|
+
background: -webkit-gradient(radial, 50% -70, 0, 50% 0, 200, from(#595959), to(#0d0d0d)) #0d0d0d;
|
198
|
+
width: 25.7em;
|
199
|
+
}
|
200
|
+
|
201
|
+
ul.tracks li.odd {
|
202
|
+
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,.05)), to(rgba(255,255,255,.05)));
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
table {
|
207
|
+
border-collapse: collapse;
|
208
|
+
margin: 1em 0;
|
209
|
+
-webkit-box-shadow: 1px 1px 5px rgba(25,25,25,0.7);
|
210
|
+
-moz-box-shadow: 1px 1px 5px #333;
|
211
|
+
background-image: -webkit-gradient(radial, 50% -70, 0, 50% 0, 200, from(#595959), to(#0d0d0d)) #0d0d0d;
|
212
|
+
}
|
213
|
+
table thead,
|
214
|
+
table tbody {
|
215
|
+
border: 1px solid #c1c1c1;
|
216
|
+
}
|
217
|
+
table th {
|
218
|
+
vertical-align: bottom;
|
219
|
+
text-align: center;
|
220
|
+
}
|
221
|
+
table.horizontal tbody th {
|
222
|
+
vertical-align: top;
|
223
|
+
text-align: right;
|
224
|
+
}
|
225
|
+
table td {
|
226
|
+
padding: 2px 0.5em;
|
227
|
+
vertical-align: top;
|
228
|
+
}
|
229
|
+
table td.numeric {
|
230
|
+
text-align: right;
|
231
|
+
}
|
232
|
+
table td.icon {
|
233
|
+
vertical-align: top;
|
234
|
+
text-align: center;
|
235
|
+
}
|
236
|
+
table td.icon img {
|
237
|
+
margin: 0 auto;
|
238
|
+
}
|
239
|
+
|
240
|
+
table th {
|
241
|
+
padding: 1px 0.5em;
|
242
|
+
}
|
243
|
+
table th.odd {
|
244
|
+
background-color: #f6f6f6;
|
245
|
+
}
|
246
|
+
table th.even {
|
247
|
+
background-color: #e5e5e5;
|
248
|
+
}
|
249
|
+
|
250
|
+
table tr.odd {
|
251
|
+
background-color: #f6ecbf;
|
252
|
+
}
|
253
|
+
table tr.odd td.even {
|
254
|
+
background-color: #e6ddb2;
|
255
|
+
}
|
256
|
+
table tr.even {
|
257
|
+
background-color: #decda8;
|
258
|
+
}
|
259
|
+
table tr.even td.even {
|
260
|
+
background-color: #c8b897;
|
261
|
+
}
|
262
|
+
|
263
|
+
dl {
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
dt {
|
268
|
+
font-weight: bold;
|
269
|
+
border-bottom: 1px solid #999;
|
270
|
+
color: #3f6217;
|
271
|
+
}
|
272
|
+
|
273
|
+
dt a {
|
274
|
+
border: none;
|
275
|
+
color: inherit;
|
276
|
+
}
|
277
|
+
|
278
|
+
dd {
|
279
|
+
margin: 0;
|
280
|
+
}
|
281
|
+
|
282
|
+
dd + dt {
|
283
|
+
margin-top: 1em;
|
284
|
+
}
|
285
|
+
|
286
|
+
p code, li code, dd code {
|
287
|
+
color: #333;
|
288
|
+
background-color: #e4e0d2;
|
289
|
+
border: 1px dotted #acaa92;
|
290
|
+
}
|
291
|
+
|
292
|
+
pre code {
|
293
|
+
color: inherit;
|
294
|
+
background-color: transparent;
|
295
|
+
border: none;
|
296
|
+
}
|
297
|
+
|
298
|
+
/* @end */
|
299
|
+
|
300
|
+
/* @group IDed page elements */
|
301
|
+
|
302
|
+
#content {
|
303
|
+
position: relative;
|
304
|
+
z-index: 0;
|
305
|
+
padding: 4em;
|
306
|
+
min-width: 900px;
|
307
|
+
}
|
308
|
+
|
309
|
+
#homelink {
|
310
|
+
position: absolute;
|
311
|
+
top: 4em;
|
312
|
+
right: 4em;
|
313
|
+
}
|
314
|
+
|
315
|
+
#footer {
|
316
|
+
font-size: 0.8em;
|
317
|
+
margin: 0;
|
318
|
+
padding: 3em 2em 1em;
|
319
|
+
}
|
320
|
+
|
321
|
+
#footer p {
|
322
|
+
margin: 0;
|
323
|
+
}
|
324
|
+
|
325
|
+
table#connection-list {
|
326
|
+
font-size: 0.9em;
|
327
|
+
}
|
328
|
+
|
329
|
+
#left {
|
330
|
+
width: 45%;
|
331
|
+
position: absolute;
|
332
|
+
}
|
333
|
+
|
334
|
+
#right {
|
335
|
+
margin-left: 55%;
|
336
|
+
}
|
337
|
+
|
338
|
+
#log {
|
339
|
+
clear: both;
|
340
|
+
}
|
341
|
+
|
342
|
+
/* @end */
|
343
|
+
|
344
|
+
|
345
|
+
/* @group classed page elements */
|
346
|
+
|
347
|
+
.dn, .oid, .uri, .socket {
|
348
|
+
padding-left: 18px;
|
349
|
+
padding-right: 0.2em;
|
350
|
+
background-color: #e8d9b7;
|
351
|
+
border: 1px solid #a38e2b;
|
352
|
+
-webkit-border-radius: 5px;
|
353
|
+
}
|
354
|
+
.dn {
|
355
|
+
background: #e8d9b7 url(../images/chain_small.png) no-repeat 2px;
|
356
|
+
}
|
357
|
+
.oid {
|
358
|
+
background: #e8d9b7 url(../images/card_small.png) no-repeat 2px;
|
359
|
+
}
|
360
|
+
.uri {
|
361
|
+
background: #e8d9b7 url(../images/globe_small_green.png) no-repeat 2px;
|
362
|
+
}
|
363
|
+
.socket {
|
364
|
+
padding-left: 22px;
|
365
|
+
background: #e8d9b7 url(../images/plug.png) no-repeat 4px;
|
366
|
+
}
|
367
|
+
|
368
|
+
.graph svg {
|
369
|
+
background-color: #e6ddb2;
|
370
|
+
background-image: -webkit-gradient(radial, 25% 0, 75, 150 100, 350, from(#e6ddb2), to(#c6bd92));
|
371
|
+
border: 1px solid #ccc;
|
372
|
+
-webkit-border-radius: 1em;
|
373
|
+
-moz-border-radius: 1em;
|
374
|
+
margin: 1em 0;
|
375
|
+
-webkit-box-shadow: 1px 1px 5px rgba(25,25,25,0.7);
|
376
|
+
-moz-box-shadow: 1px 1px 5px #333;
|
377
|
+
}
|
378
|
+
|
379
|
+
/* @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.
|
29
|
+
VERSION = '1.8.6'
|
30
30
|
|
31
31
|
# VCS revision
|
32
|
-
REVISION = %q$Revision:
|
32
|
+
REVISION = %q$Revision: 4b71de99d5fd $
|
33
33
|
|
34
34
|
# Common paths for ldap.conf
|
35
35
|
COMMON_LDAP_CONF_PATHS = %w[
|
data/lib/treequel/constants.rb
CHANGED
@@ -35,8 +35,8 @@ module Treequel::Constants
|
|
35
35
|
:matchedvals => '1.2.826.0.1.3344810.2.2',
|
36
36
|
:matchedvalues => '1.2.826.0.1.3344810.2.3',
|
37
37
|
|
38
|
-
# MS Active Directory controls, from various MSDN references, most
|
39
|
-
# notably:
|
38
|
+
# MS Active Directory controls, from various MSDN references, most
|
39
|
+
# notably:
|
40
40
|
# http://msdn.microsoft.com/en-us/library/cc223320%28PROT.10%29.aspx
|
41
41
|
:paged => '1.2.840.113556.1.4.319',
|
42
42
|
:server_show_deleted => '1.2.840.113556.1.4.417',
|
data/lib/treequel/directory.rb
CHANGED
@@ -558,13 +558,20 @@ class Treequel::Directory
|
|
558
558
|
### Map the specified LDAP +attribute+ to its Ruby datatype if one is registered for the given
|
559
559
|
### syntax +oid+. If there is no conversion registered, just return the +value+ as-is.
|
560
560
|
def convert_to_object( oid, attribute )
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
561
|
+
if conversion = @attribute_conversions[ oid ]
|
562
|
+
if conversion.respond_to?( :call )
|
563
|
+
attribute = conversion.call( attribute, self )
|
564
|
+
else
|
565
|
+
attribute = conversion[ attribute ]
|
566
|
+
end
|
567
567
|
end
|
568
|
+
|
569
|
+
# Force the encoding to UTF8, as that's what the directory should be returning.
|
570
|
+
# Ruby-LDAP returns values as ASCII-8BIT.
|
571
|
+
attribute = attribute.dup.force_encoding( Encoding::UTF_8 ) if
|
572
|
+
attribute.respond_to?( :force_encoding )
|
573
|
+
|
574
|
+
return attribute
|
568
575
|
end
|
569
576
|
|
570
577
|
|
data/spec/lib/helpers.rb
CHANGED
@@ -186,10 +186,19 @@ RSpec.configure do |c|
|
|
186
186
|
c.include( Treequel::SpecHelpers )
|
187
187
|
c.include( Treequel::Matchers )
|
188
188
|
|
189
|
-
c.
|
190
|
-
|
191
|
-
|
189
|
+
c.treat_symbols_as_metadata_keys_with_true_values = true
|
190
|
+
|
191
|
+
if RUBY_VERSION >= '1.9.0'
|
192
|
+
c.filter_run_excluding( :ruby_18 )
|
193
|
+
else
|
194
|
+
c.filter_run_excluding( :ruby_19 )
|
195
|
+
end
|
196
|
+
|
197
|
+
c.filter_run_excluding( :mri_only ) if
|
192
198
|
defined?( RUBY_ENGINE ) && RUBY_ENGINE != 'ruby'
|
199
|
+
c.filter_run_excluding( :sequel ) unless
|
200
|
+
Sequel.const_defined?( :Model )
|
201
|
+
|
193
202
|
end
|
194
203
|
|
195
204
|
# vim: set nosta noet ts=4 sw=4:
|
@@ -306,7 +306,7 @@ describe Treequel::Directory do
|
|
306
306
|
and_return( true )
|
307
307
|
branch.should_receive( :respond_to? ).with( :dn ).
|
308
308
|
and_return( true )
|
309
|
-
|
309
|
+
branch.stub( :include_operational_attrs? ).and_return( true )
|
310
310
|
|
311
311
|
found_branch1 = stub( "entry1 branch" )
|
312
312
|
found_branch2 = stub( "entry2 branch" )
|
@@ -602,6 +602,11 @@ describe Treequel::Directory do
|
|
602
602
|
@dir.convert_to_attribute( OIDS::BOOLEAN_SYNTAX, true ).should == 'true'
|
603
603
|
end
|
604
604
|
|
605
|
+
it "forces the encoding of DirectoryString attributes to UTF-8", :ruby_19 do
|
606
|
+
directory_value = 'a value'.force_encoding( Encoding::ASCII_8BIT )
|
607
|
+
rval = @dir.convert_to_object( OIDS::STRING_SYNTAX, directory_value )
|
608
|
+
rval.encoding.should == Encoding::UTF_8
|
609
|
+
end
|
605
610
|
|
606
611
|
### Controls support
|
607
612
|
describe "to a server that supports controls introspection" do
|
@@ -414,31 +414,27 @@ describe Treequel::Filter do
|
|
414
414
|
end
|
415
415
|
end
|
416
416
|
|
417
|
-
describe "support for Sequel expressions", :
|
417
|
+
describe "support for Sequel expressions", :sequel do
|
418
418
|
|
419
|
-
|
420
|
-
pending "requires the 'sequel' library" unless Sequel.const_defined?( :Model )
|
421
|
-
end
|
422
|
-
|
423
|
-
it "supports the boolean expression syntax", :ruby_1_8_only => true do
|
419
|
+
it "supports the boolean expression syntax", :ruby_18 do
|
424
420
|
filter = Treequel::Filter.new( :uid >= 2000 )
|
425
421
|
filter.should be_a( Treequel::Filter )
|
426
422
|
filter.to_s.should == '(uid>=2000)'
|
427
423
|
end
|
428
424
|
|
429
|
-
it "supports Sequel expressions in ANDed subexpressions", :
|
425
|
+
it "supports Sequel expressions in ANDed subexpressions", :ruby_18 do
|
430
426
|
filter = Treequel::Filter.new( :and, [:uid >= 1024], [:uid <= 65535] )
|
431
427
|
filter.should be_a( Treequel::Filter )
|
432
428
|
filter.to_s.should == '(&(uid>=1024)(uid<=65535))'
|
433
429
|
end
|
434
430
|
|
435
|
-
it "advises user to use '>=' instead of '>' in expressions", :
|
431
|
+
it "advises user to use '>=' instead of '>' in expressions", :ruby_18 do
|
436
432
|
expect {
|
437
433
|
Treequel::Filter.new( :uid > 1024 )
|
438
434
|
}.to raise_error( Treequel::ExpressionError, /greater-than-or-equal/i )
|
439
435
|
end
|
440
436
|
|
441
|
-
it "advises user to use '<=' instead of '<' in expressions", :
|
437
|
+
it "advises user to use '<=' instead of '<' in expressions", :ruby_18 do
|
442
438
|
expect {
|
443
439
|
Treequel::Filter.new( :activated < Time.now )
|
444
440
|
}.to raise_error( Treequel::ExpressionError, /less-than-or-equal/i )
|
@@ -253,7 +253,7 @@ describe Treequel, "mixin" do
|
|
253
253
|
blockarg.should == :the_block_argument
|
254
254
|
end
|
255
255
|
|
256
|
-
it "reports errors from its caller's perspective", :
|
256
|
+
it "reports errors from its caller's perspective", :ruby_18 do
|
257
257
|
begin
|
258
258
|
@obj.erroring_delegated_method
|
259
259
|
rescue NoMethodError => err
|
@@ -307,7 +307,7 @@ describe Treequel, "mixin" do
|
|
307
307
|
blockarg.should == :the_block_argument
|
308
308
|
end
|
309
309
|
|
310
|
-
it "reports errors from its caller's perspective", :
|
310
|
+
it "reports errors from its caller's perspective", :ruby_18 do
|
311
311
|
begin
|
312
312
|
@obj.erroring_delegated_method
|
313
313
|
rescue NoMethodError => err
|
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
|
+
version: 1.8.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -37,11 +37,11 @@ cert_chain:
|
|
37
37
|
YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
|
38
38
|
Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
|
39
39
|
cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
40
|
-
date: 2012-03-
|
40
|
+
date: 2012-03-20 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: ruby-ldap
|
44
|
-
requirement: &
|
44
|
+
requirement: &70318636160660 !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
46
|
requirements:
|
47
47
|
- - ~>
|
@@ -49,10 +49,10 @@ dependencies:
|
|
49
49
|
version: '0.9'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
|
-
version_requirements: *
|
52
|
+
version_requirements: *70318636160660
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: hoe-mercurial
|
55
|
-
requirement: &
|
55
|
+
requirement: &70318636160220 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|
58
58
|
- - ~>
|
@@ -60,10 +60,10 @@ dependencies:
|
|
60
60
|
version: 1.3.1
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
|
-
version_requirements: *
|
63
|
+
version_requirements: *70318636160220
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: hoe-highline
|
66
|
-
requirement: &
|
66
|
+
requirement: &70318636159740 !ruby/object:Gem::Requirement
|
67
67
|
none: false
|
68
68
|
requirements:
|
69
69
|
- - ~>
|
@@ -71,21 +71,21 @@ dependencies:
|
|
71
71
|
version: 0.0.1
|
72
72
|
type: :development
|
73
73
|
prerelease: false
|
74
|
-
version_requirements: *
|
74
|
+
version_requirements: *70318636159740
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rspec
|
77
|
-
requirement: &
|
77
|
+
requirement: &70318636159220 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
82
|
+
version: '2.8'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
|
-
version_requirements: *
|
85
|
+
version_requirements: *70318636159220
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: ruby-termios
|
88
|
-
requirement: &
|
88
|
+
requirement: &70318636158740 !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
@@ -93,10 +93,10 @@ dependencies:
|
|
93
93
|
version: '0.9'
|
94
94
|
type: :development
|
95
95
|
prerelease: false
|
96
|
-
version_requirements: *
|
96
|
+
version_requirements: *70318636158740
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ruby-terminfo
|
99
|
-
requirement: &
|
99
|
+
requirement: &70318636158260 !ruby/object:Gem::Requirement
|
100
100
|
none: false
|
101
101
|
requirements:
|
102
102
|
- - ~>
|
@@ -104,10 +104,10 @@ dependencies:
|
|
104
104
|
version: '0.1'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
|
-
version_requirements: *
|
107
|
+
version_requirements: *70318636158260
|
108
108
|
- !ruby/object:Gem::Dependency
|
109
109
|
name: columnize
|
110
|
-
requirement: &
|
110
|
+
requirement: &70318636157780 !ruby/object:Gem::Requirement
|
111
111
|
none: false
|
112
112
|
requirements:
|
113
113
|
- - ~>
|
@@ -115,10 +115,10 @@ dependencies:
|
|
115
115
|
version: '0.3'
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
|
-
version_requirements: *
|
118
|
+
version_requirements: *70318636157780
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: sysexits
|
121
|
-
requirement: &
|
121
|
+
requirement: &70318636173720 !ruby/object:Gem::Requirement
|
122
122
|
none: false
|
123
123
|
requirements:
|
124
124
|
- - ~>
|
@@ -126,10 +126,10 @@ dependencies:
|
|
126
126
|
version: '1.0'
|
127
127
|
type: :development
|
128
128
|
prerelease: false
|
129
|
-
version_requirements: *
|
129
|
+
version_requirements: *70318636173720
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
131
|
name: sequel
|
132
|
-
requirement: &
|
132
|
+
requirement: &70318636172900 !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
134
134
|
requirements:
|
135
135
|
- - ~>
|
@@ -137,10 +137,10 @@ dependencies:
|
|
137
137
|
version: '3.20'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
|
-
version_requirements: *
|
140
|
+
version_requirements: *70318636172900
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: rdoc
|
143
|
-
requirement: &
|
143
|
+
requirement: &70318636172020 !ruby/object:Gem::Requirement
|
144
144
|
none: false
|
145
145
|
requirements:
|
146
146
|
- - ~>
|
@@ -148,18 +148,18 @@ dependencies:
|
|
148
148
|
version: '3.10'
|
149
149
|
type: :development
|
150
150
|
prerelease: false
|
151
|
-
version_requirements: *
|
151
|
+
version_requirements: *70318636172020
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: hoe
|
154
|
-
requirement: &
|
154
|
+
requirement: &70318636171580 !ruby/object:Gem::Requirement
|
155
155
|
none: false
|
156
156
|
requirements:
|
157
157
|
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '2.
|
159
|
+
version: '2.16'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
|
-
version_requirements: *
|
162
|
+
version_requirements: *70318636171580
|
163
163
|
description: ! "Treequel is an LDAP toolkit for Ruby. It is intended to allow quick,
|
164
164
|
easy\naccess to LDAP directories in a manner consistent with LDAP's hierarchical,\nfree-form
|
165
165
|
nature. \n\nIt's inspired by and modeled after {Sequel}[http://sequel.rubyforge.org/],
|
@@ -173,8 +173,8 @@ executables:
|
|
173
173
|
- treewhat
|
174
174
|
extensions: []
|
175
175
|
extra_rdoc_files:
|
176
|
-
- Manifest.txt
|
177
176
|
- History.rdoc
|
177
|
+
- Manifest.txt
|
178
178
|
- README.rdoc
|
179
179
|
files:
|
180
180
|
- .gemtest
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- examples/company-directory.rb
|
191
191
|
- examples/ldap-rack-auth.rb
|
192
192
|
- examples/ldap_state.rb
|
193
|
+
- examples/webroot/css/master.css
|
193
194
|
- lib/treequel.rb
|
194
195
|
- lib/treequel/behavior/control.rb
|
195
196
|
- lib/treequel/branch.rb
|
metadata.gz.sig
CHANGED
Binary file
|