treequel 1.2.2 → 1.3.0pre384
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/ChangeLog +3374 -0
- data/History.md +39 -0
- data/LICENSE +27 -0
- data/README.md +25 -2
- data/Rakefile +64 -29
- data/bin/treequel +16 -25
- data/bin/treewhat +318 -0
- data/lib/treequel.rb +13 -3
- data/lib/treequel/behavior/control.rb +40 -0
- data/lib/treequel/branch.rb +56 -28
- data/lib/treequel/branchset.rb +10 -2
- data/lib/treequel/controls/pagedresults.rb +4 -2
- data/lib/treequel/directory.rb +40 -50
- data/lib/treequel/exceptions.rb +18 -0
- data/lib/treequel/mixins.rb +44 -14
- data/lib/treequel/model.rb +338 -21
- data/lib/treequel/model/errors.rb +79 -0
- data/lib/treequel/model/objectclass.rb +26 -2
- data/lib/treequel/model/schemavalidations.rb +69 -0
- data/lib/treequel/monkeypatches.rb +99 -17
- data/lib/treequel/schema.rb +19 -5
- data/spec/lib/constants.rb +20 -2
- data/spec/lib/helpers.rb +25 -8
- data/spec/treequel/branch_spec.rb +73 -10
- data/spec/treequel/controls/contentsync_spec.rb +2 -11
- data/spec/treequel/controls/pagedresults_spec.rb +25 -9
- data/spec/treequel/controls/sortedresults_spec.rb +8 -10
- data/spec/treequel/directory_spec.rb +74 -63
- data/spec/treequel/model/errors_spec.rb +77 -0
- data/spec/treequel/model/objectclass_spec.rb +107 -35
- data/spec/treequel/model/schemavalidations_spec.rb +112 -0
- data/spec/treequel/model_spec.rb +294 -81
- data/spec/treequel/monkeypatches_spec.rb +49 -3
- metadata +28 -16
- metadata.gz.sig +0 -0
- data/spec/lib/control_behavior.rb +0 -47
@@ -6,14 +6,13 @@ BEGIN {
|
|
6
6
|
|
7
7
|
libdir = basedir + "lib"
|
8
8
|
|
9
|
-
$LOAD_PATH.unshift(
|
9
|
+
$LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
|
10
|
+
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
10
11
|
}
|
11
12
|
|
12
13
|
require 'time'
|
13
|
-
|
14
14
|
require 'rspec'
|
15
15
|
|
16
|
-
require 'spec/lib/constants'
|
17
16
|
require 'spec/lib/helpers'
|
18
17
|
|
19
18
|
require 'treequel'
|
@@ -126,4 +125,51 @@ describe Treequel::TimeExtensions do
|
|
126
125
|
end
|
127
126
|
|
128
127
|
|
128
|
+
describe Treequel::DateExtensions do
|
129
|
+
|
130
|
+
before( :all ) do
|
131
|
+
# Make the local timezone PDT so offsets show up correctly
|
132
|
+
@real_tz = ENV['TZ']
|
133
|
+
ENV['TZ'] = ':PST8PDT'
|
134
|
+
end
|
135
|
+
|
136
|
+
before( :each ) do
|
137
|
+
@date = Date.parse( "2010-08-05" )
|
138
|
+
end
|
139
|
+
|
140
|
+
after( :all ) do
|
141
|
+
ENV['TZ'] = @real_tz
|
142
|
+
end
|
143
|
+
|
144
|
+
describe "RFC4517 LDAP Generalized Time method" do
|
145
|
+
|
146
|
+
it "returns the time in 'Generalized Time' format" do
|
147
|
+
@date.ldap_generalized.should == "20100805000001-0800"
|
148
|
+
end
|
149
|
+
|
150
|
+
it "can include fractional seconds if the optional fractional digits argument is given" do
|
151
|
+
@date.ldap_generalized( 3 ).should == "20100805000001.000-0800"
|
152
|
+
end
|
153
|
+
|
154
|
+
it "doesn't include the decimal if fractional digits is specified but zero" do
|
155
|
+
@date.ldap_generalized( 0 ).should == "20100805000001-0800"
|
156
|
+
end
|
157
|
+
|
158
|
+
it "zero-fills any digits after six in the fractional digits" do
|
159
|
+
@date.ldap_generalized( 11 ).should == "20100805000001.00000000000-0800"
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
|
164
|
+
describe "RFC4517 UTC Time method" do
|
165
|
+
|
166
|
+
it "returns the time in 'UTC Time' format" do
|
167
|
+
@date.ldap_utc.should == "100805000001-0800"
|
168
|
+
end
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
end
|
173
|
+
|
174
|
+
|
129
175
|
# vim: set nosta noet ts=4 sw=4:
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0pre384
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Granger
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date:
|
39
|
+
date: 2011-01-10 00:00:00 -08:00
|
40
40
|
default_executable:
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
@@ -72,19 +72,19 @@ dependencies:
|
|
72
72
|
type: :development
|
73
73
|
version_requirements: *id002
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
|
-
name:
|
75
|
+
name: columnize
|
76
76
|
prerelease: false
|
77
77
|
requirement: &id003 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
hash:
|
82
|
+
hash: 17
|
83
83
|
segments:
|
84
|
-
- 2
|
85
|
-
- 1
|
86
84
|
- 0
|
87
|
-
|
85
|
+
- 3
|
86
|
+
- 1
|
87
|
+
version: 0.3.1
|
88
88
|
type: :development
|
89
89
|
version_requirements: *id003
|
90
90
|
- !ruby/object:Gem::Dependency
|
@@ -120,19 +120,19 @@ dependencies:
|
|
120
120
|
type: :development
|
121
121
|
version_requirements: *id005
|
122
122
|
- !ruby/object:Gem::Dependency
|
123
|
-
name:
|
123
|
+
name: rspec
|
124
124
|
prerelease: false
|
125
125
|
requirement: &id006 !ruby/object:Gem::Requirement
|
126
126
|
none: false
|
127
127
|
requirements:
|
128
128
|
- - ~>
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
hash:
|
130
|
+
hash: 31
|
131
131
|
segments:
|
132
|
+
- 2
|
133
|
+
- 4
|
132
134
|
- 0
|
133
|
-
|
134
|
-
- 1
|
135
|
-
version: 0.6.1
|
135
|
+
version: 2.4.0
|
136
136
|
type: :development
|
137
137
|
version_requirements: *id006
|
138
138
|
- !ruby/object:Gem::Dependency
|
@@ -164,19 +164,25 @@ email:
|
|
164
164
|
executables:
|
165
165
|
- treeirb
|
166
166
|
- treequel
|
167
|
+
- treewhat
|
167
168
|
extensions: []
|
168
169
|
|
169
170
|
extra_rdoc_files:
|
170
171
|
- History.md
|
171
172
|
files:
|
173
|
+
- ChangeLog
|
174
|
+
- History.md
|
175
|
+
- LICENSE
|
172
176
|
- README.md
|
173
177
|
- Rakefile
|
174
178
|
- bin/treeirb
|
175
179
|
- bin/treequel
|
180
|
+
- bin/treewhat
|
176
181
|
- examples/company-directory.rb
|
177
182
|
- examples/ldap-rack-auth.rb
|
178
183
|
- examples/ldap_state.rb
|
179
184
|
- lib/treequel.rb
|
185
|
+
- lib/treequel/behavior/control.rb
|
180
186
|
- lib/treequel/branch.rb
|
181
187
|
- lib/treequel/branchcollection.rb
|
182
188
|
- lib/treequel/branchset.rb
|
@@ -190,7 +196,9 @@ files:
|
|
190
196
|
- lib/treequel/filter.rb
|
191
197
|
- lib/treequel/mixins.rb
|
192
198
|
- lib/treequel/model.rb
|
199
|
+
- lib/treequel/model/errors.rb
|
193
200
|
- lib/treequel/model/objectclass.rb
|
201
|
+
- lib/treequel/model/schemavalidations.rb
|
194
202
|
- lib/treequel/monkeypatches.rb
|
195
203
|
- lib/treequel/schema.rb
|
196
204
|
- lib/treequel/schema/attributetype.rb
|
@@ -204,7 +212,6 @@ files:
|
|
204
212
|
- spec/data/objectClasses.yml
|
205
213
|
- spec/data/schema.yml
|
206
214
|
- spec/lib/constants.rb
|
207
|
-
- spec/lib/control_behavior.rb
|
208
215
|
- spec/lib/helpers.rb
|
209
216
|
- spec/lib/matchers.rb
|
210
217
|
- spec/treequel/branch_spec.rb
|
@@ -217,7 +224,9 @@ files:
|
|
217
224
|
- spec/treequel/directory_spec.rb
|
218
225
|
- spec/treequel/filter_spec.rb
|
219
226
|
- spec/treequel/mixins_spec.rb
|
227
|
+
- spec/treequel/model/errors_spec.rb
|
220
228
|
- spec/treequel/model/objectclass_spec.rb
|
229
|
+
- spec/treequel/model/schemavalidations_spec.rb
|
221
230
|
- spec/treequel/model_spec.rb
|
222
231
|
- spec/treequel/monkeypatches_spec.rb
|
223
232
|
- spec/treequel/schema/attributetype_spec.rb
|
@@ -228,7 +237,6 @@ files:
|
|
228
237
|
- spec/treequel/schema/table_spec.rb
|
229
238
|
- spec/treequel/schema_spec.rb
|
230
239
|
- spec/treequel_spec.rb
|
231
|
-
- History.md
|
232
240
|
has_rdoc: yard
|
233
241
|
homepage: http://deveiate.org/projects/Treequel
|
234
242
|
licenses:
|
@@ -236,9 +244,13 @@ licenses:
|
|
236
244
|
post_install_message: |-
|
237
245
|
If you want to use the included 'treequel' LDAP shell, you'll need to install
|
238
246
|
the following libraries as well:
|
247
|
+
|
239
248
|
- termios
|
240
249
|
- ruby-terminfo
|
241
250
|
- columnize
|
251
|
+
|
252
|
+
You can install those automatically if you use the --development flag when
|
253
|
+
installing Treequel.
|
242
254
|
rdoc_options:
|
243
255
|
- --use-cache
|
244
256
|
- --protected
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
BEGIN {
|
4
|
-
require 'pathname'
|
5
|
-
basedir = Pathname.new( __FILE__ ).dirname.parent.parent
|
6
|
-
|
7
|
-
libdir = basedir + "lib"
|
8
|
-
|
9
|
-
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
|
10
|
-
$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
|
11
|
-
}
|
12
|
-
|
13
|
-
require 'rspec'
|
14
|
-
|
15
|
-
require 'spec/lib/constants'
|
16
|
-
require 'spec/lib/helpers'
|
17
|
-
|
18
|
-
require 'treequel'
|
19
|
-
require 'treequel/control'
|
20
|
-
|
21
|
-
include Treequel::TestConstants
|
22
|
-
include Treequel::Constants
|
23
|
-
|
24
|
-
#####################################################################
|
25
|
-
### C O N T E X T S
|
26
|
-
#####################################################################
|
27
|
-
shared_examples_for "A Treequel::Control" do
|
28
|
-
include Treequel::SpecHelpers
|
29
|
-
|
30
|
-
let( :control ) do
|
31
|
-
described_class
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
it "implements one of either #get_client_controls or #get_server_controls" do
|
36
|
-
methods = [
|
37
|
-
'get_client_controls', # 1.8.x
|
38
|
-
'get_server_controls',
|
39
|
-
:get_client_controls, # 1.9.x
|
40
|
-
:get_server_controls
|
41
|
-
]
|
42
|
-
(control.instance_methods( false ) | methods).should_not be_empty()
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
|