activeldap 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/CHANGES +34 -0
  2. data/README +13 -0
  3. data/Rakefile +2 -1
  4. data/TODO +6 -0
  5. data/benchmark/bench-al.rb +68 -17
  6. data/examples/al-admin/app/helpers/application_helper.rb +3 -5
  7. data/examples/al-admin/app/views/layouts/_footer.html.erb +2 -0
  8. data/examples/al-admin/config/boot.rb +7 -7
  9. data/examples/al-admin/config/environment.rb +27 -12
  10. data/examples/al-admin/config/environments/development.rb +0 -1
  11. data/examples/al-admin/config/environments/production.rb +6 -1
  12. data/examples/al-admin/config/environments/test.rb +1 -1
  13. data/examples/al-admin/config/initializers/gettext.rb +15 -1
  14. data/examples/al-admin/po/en/al-admin.po +1 -1
  15. data/examples/al-admin/po/ja/al-admin.po +1 -1
  16. data/examples/al-admin/po/nl/al-admin.po +1 -1
  17. data/examples/al-admin/public/dispatch.cgi +0 -0
  18. data/examples/al-admin/public/dispatch.fcgi +0 -0
  19. data/examples/al-admin/public/dispatch.rb +0 -0
  20. data/examples/al-admin/public/javascripts/controls.js +73 -73
  21. data/examples/al-admin/public/javascripts/dragdrop.js +166 -165
  22. data/examples/al-admin/public/javascripts/effects.js +174 -166
  23. data/examples/al-admin/public/javascripts/prototype.js +362 -267
  24. data/examples/al-admin/script/about +0 -0
  25. data/examples/al-admin/script/console +0 -0
  26. data/examples/al-admin/script/dbconsole +3 -0
  27. data/examples/al-admin/script/destroy +0 -0
  28. data/examples/al-admin/script/generate +0 -0
  29. data/examples/al-admin/script/performance/benchmarker +0 -0
  30. data/examples/al-admin/script/performance/profiler +0 -0
  31. data/examples/al-admin/script/performance/request +0 -0
  32. data/examples/al-admin/script/plugin +0 -0
  33. data/examples/al-admin/script/process/inspector +0 -0
  34. data/examples/al-admin/script/process/reaper +0 -0
  35. data/examples/al-admin/script/process/spawner +0 -0
  36. data/examples/al-admin/script/runner +0 -0
  37. data/examples/al-admin/script/server +0 -0
  38. data/examples/al-admin/test/run-test.sh +0 -0
  39. data/examples/groupadd +0 -0
  40. data/examples/groupdel +0 -0
  41. data/examples/groupls +0 -0
  42. data/examples/groupmod +0 -0
  43. data/examples/lpasswd +0 -0
  44. data/examples/ouadd +0 -0
  45. data/examples/useradd +0 -0
  46. data/examples/useradd-binary +0 -0
  47. data/examples/userdel +0 -0
  48. data/examples/userls +0 -0
  49. data/examples/usermod +0 -0
  50. data/examples/usermod-binary-add +0 -0
  51. data/examples/usermod-binary-add-time +0 -0
  52. data/examples/usermod-binary-del +0 -0
  53. data/examples/usermod-lang-add +0 -0
  54. data/lib/active_ldap.rb +10 -4
  55. data/lib/active_ldap/action_controller/ldap_benchmarking.rb +28 -9
  56. data/lib/active_ldap/adapter/base.rb +30 -17
  57. data/lib/active_ldap/adapter/jndi.rb +5 -1
  58. data/lib/active_ldap/adapter/ldap.rb +5 -1
  59. data/lib/active_ldap/association/has_many_utils.rb +7 -1
  60. data/lib/active_ldap/associations.rb +10 -5
  61. data/lib/active_ldap/attributes.rb +6 -1
  62. data/lib/active_ldap/base.rb +154 -52
  63. data/lib/active_ldap/configuration.rb +1 -1
  64. data/lib/active_ldap/connection.rb +7 -4
  65. data/lib/active_ldap/get_text.rb +11 -3
  66. data/lib/active_ldap/ldif.rb +16 -4
  67. data/lib/active_ldap/operations.rb +13 -5
  68. data/lib/active_ldap/schema.rb +6 -2
  69. data/lib/active_ldap/schema/syntaxes.rb +15 -3
  70. data/lib/active_ldap/user_password.rb +4 -4
  71. data/lib/active_ldap/validations.rb +32 -44
  72. data/lib/active_ldap/xml.rb +125 -0
  73. data/po/en/active-ldap.po +740 -85
  74. data/po/ja/active-ldap.po +748 -547
  75. data/rails/README +54 -0
  76. data/rails/init.rb +33 -0
  77. data/rails/plugin/active_ldap/generators/README +2 -0
  78. data/rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb +1 -1
  79. data/rails/plugin/active_ldap/init.rb +3 -0
  80. data/rails_generators/model_active_ldap/USAGE +17 -0
  81. data/rails_generators/model_active_ldap/model_active_ldap_generator.rb +69 -0
  82. data/rails_generators/model_active_ldap/templates/model_active_ldap.rb +3 -0
  83. data/rails_generators/model_active_ldap/templates/unit_test.rb +8 -0
  84. data/rails_generators/scaffold_active_ldap/scaffold_active_ldap_generator.rb +7 -0
  85. data/rails_generators/scaffold_active_ldap/templates/ldap.yml +18 -0
  86. data/rails_generators/scaffold_al/scaffold_al_generator.rb +20 -0
  87. data/test-unit/History.txt +50 -1
  88. data/test-unit/Manifest.txt +22 -12
  89. data/test-unit/README.txt +31 -12
  90. data/test-unit/Rakefile +14 -1
  91. data/test-unit/TODO +5 -0
  92. data/test-unit/bin/testrb +0 -0
  93. data/test-unit/lib/test/unit.rb +62 -0
  94. data/test-unit/lib/test/unit/assertions.rb +419 -75
  95. data/test-unit/lib/test/unit/autorunner.rb +70 -13
  96. data/test-unit/lib/test/unit/collector.rb +1 -1
  97. data/test-unit/lib/test/unit/collector/load.rb +1 -1
  98. data/test-unit/lib/test/unit/color-scheme.rb +86 -0
  99. data/test-unit/lib/test/unit/color.rb +40 -5
  100. data/test-unit/lib/test/unit/diff.rb +14 -0
  101. data/test-unit/lib/test/unit/fixture.rb +7 -16
  102. data/test-unit/lib/test/unit/notification.rb +9 -0
  103. data/test-unit/lib/test/unit/omission.rb +14 -0
  104. data/test-unit/lib/test/unit/pending.rb +16 -0
  105. data/test-unit/lib/test/unit/priority.rb +17 -2
  106. data/test-unit/lib/test/unit/runner/console.rb +8 -2
  107. data/test-unit/lib/test/unit/testcase.rb +188 -2
  108. data/test-unit/lib/test/unit/ui/console/testrunner.rb +51 -26
  109. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  110. data/test-unit/lib/test/unit/version.rb +1 -1
  111. data/test-unit/sample/test_user.rb +22 -0
  112. data/test-unit/test/collector/{test_descendant.rb → test-descendant.rb} +0 -0
  113. data/test-unit/test/collector/{test_load.rb → test-load.rb} +1 -1
  114. data/test-unit/test/run-test.rb +0 -0
  115. data/test-unit/test/{test_attribute.rb → test-attribute.rb} +0 -0
  116. data/test-unit/test/test-color-scheme.rb +56 -0
  117. data/test-unit/test/{test_color.rb → test-color.rb} +10 -0
  118. data/test-unit/test/{test_diff.rb → test-diff.rb} +0 -0
  119. data/test-unit/test/{test_emacs_runner.rb → test-emacs-runner.rb} +0 -0
  120. data/test-unit/test/test-fixture.rb +287 -0
  121. data/test-unit/test/{test_notification.rb → test-notification.rb} +4 -4
  122. data/test-unit/test/{test_omission.rb → test-omission.rb} +6 -6
  123. data/test-unit/test/{test_pending.rb → test-pending.rb} +12 -6
  124. data/test-unit/test/{test_priority.rb → test-priority.rb} +30 -0
  125. data/test-unit/test/test_assertions.rb +411 -69
  126. data/test-unit/test/test_testcase.rb +70 -3
  127. data/test-unit/test/{testunit_test_util.rb → testunit-test-util.rb} +4 -2
  128. data/test-unit/test/ui/test_testrunmediator.rb +1 -1
  129. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  130. data/test/run-test.rb +0 -0
  131. data/test/test_adapter.rb +3 -0
  132. data/test/test_associations.rb +50 -7
  133. data/test/test_base.rb +193 -11
  134. data/test/test_connection_per_dn.rb +1 -1
  135. data/test/test_ldif.rb +86 -0
  136. data/test/test_load.rb +7 -0
  137. data/test/test_schema.rb +31 -1
  138. data/test/test_syntax.rb +20 -0
  139. data/test/test_user_password.rb +22 -14
  140. data/test/test_validation.rb +70 -29
  141. metadata +99 -77
  142. data/data/locale/en/LC_MESSAGES/active-ldap.mo +0 -0
  143. data/data/locale/ja/LC_MESSAGES/active-ldap.mo +0 -0
  144. data/examples/al-admin/config/initializers/ralative_url_support.rb +0 -1
  145. data/examples/al-admin/lib/accept_http_rails_relative_url_root.rb +0 -9
  146. data/test-unit-ext/misc/rd2html.rb +0 -42
  147. data/test-unit/test/test_fixture.rb +0 -275
@@ -1 +0,0 @@
1
- require 'accept_http_rails_relative_url_root'
@@ -1,9 +0,0 @@
1
- module ActionController
2
- class AbstractRequest
3
- def relative_url_root_with_accept_http_rails_relative_url_root
4
- @env["RAILS_RELATIVE_URL_ROOT"] ||= @env["HTTP_RAILS_RELATIVE_URL_ROOT"]
5
- relative_url_root_without_accept_http_rails_relative_url_root
6
- end
7
- alias_method_chain :relative_url_root, :accept_http_rails_relative_url_root
8
- end
9
- end
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
4
- html_dir = File.join(top, "html")
5
-
6
- require "fileutils"
7
-
8
- css = "base.css"
9
- kcode = "utf8"
10
-
11
- options = [
12
- "-I#{File.join(top, 'misc')}",
13
- "-S",
14
- "rd2",
15
- "-rrd/rd2html-lib",
16
- "--out-code=#{kcode}",
17
- proc do |f|
18
- "--html-title=#{File.basename(f)}"
19
- end,
20
- # proc do |f|
21
- # "--with-css=#{css}"
22
- # end,
23
- proc do |f|
24
- f
25
- end
26
- ]
27
-
28
- Dir[File.join(top, "*.{ja,en}")].each do |f|
29
- if /(README|NEWS)\.(ja|en)\z/ =~ f
30
- args = options.collect do |x|
31
- if x.respond_to?(:call)
32
- x.call(f)
33
- else
34
- x
35
- end
36
- end
37
- output_base = File.basename(f).downcase.sub(/(ja|en)\z/, "html.\\1")
38
- File.open(File.join(html_dir, output_base), "w") do |out|
39
- out.puts(`ruby #{args.flatten.join(' ')}`)
40
- end
41
- end
42
- end
@@ -1,275 +0,0 @@
1
- class TestUnitFixture < Test::Unit::TestCase
2
- def test_setup_without_option
3
- test_case = assert_setup([:setup,
4
- :custom_setup_method0,
5
- :custom_setup_method1,
6
- :custom_setup_method3],
7
- [])
8
- assert_inherited_setup([:setup,
9
- :custom_setup_method0,
10
- :custom_setup_method1,
11
- :custom_setup_method3],
12
- test_case)
13
- assert_inherited_setup([:setup], nil)
14
- end
15
-
16
- def test_setup_with_before_option
17
- test_case = assert_setup([:custom_setup_method3,
18
- :custom_setup_method0,
19
- :custom_setup_method1,
20
- :setup],
21
- [[{:before => :append}],
22
- [{:before => :append}],
23
- [{:before => :prepend}],
24
- [{:before => :prepend}]])
25
- assert_inherited_setup([:custom_setup_method3,
26
- :custom_setup_method0,
27
- :custom_setup_method1,
28
- :setup],
29
- test_case)
30
- assert_inherited_setup([:setup], nil)
31
- end
32
-
33
- def test_setup_with_after_option
34
- test_case = assert_setup([:setup,
35
- :custom_setup_method3,
36
- :custom_setup_method0,
37
- :custom_setup_method1],
38
- [[{:after => :append}],
39
- [{:after => :append}],
40
- [{:after => :prepend}],
41
- [{:after => :prepend}]])
42
- assert_inherited_setup([:setup,
43
- :custom_setup_method3,
44
- :custom_setup_method0,
45
- :custom_setup_method1],
46
- test_case)
47
- assert_inherited_setup([:setup], nil)
48
- end
49
-
50
- def test_setup_with_invalid_option
51
- assert_invalid_setup_option(:unknown => true)
52
- assert_invalid_setup_option(:before => :unknown)
53
- assert_invalid_setup_option(:after => :unknown)
54
- end
55
-
56
- def test_teardown_without_option
57
- test_case = assert_teardown([:custom_teardown_method3,
58
- :custom_teardown_method1,
59
- :custom_teardown_method0,
60
- :teardown],
61
- [])
62
- assert_inherited_teardown([:custom_teardown_method3,
63
- :custom_teardown_method1,
64
- :custom_teardown_method0,
65
- :teardown],
66
- test_case)
67
- assert_inherited_teardown([:teardown], nil)
68
- end
69
-
70
- def test_teardown_with_before_option
71
- test_case = assert_teardown([:custom_teardown_method3,
72
- :custom_teardown_method0,
73
- :custom_teardown_method1,
74
- :teardown],
75
- [[{:before => :append}],
76
- [{:before => :append}],
77
- [{:before => :prepend}],
78
- [{:before => :prepend}]])
79
- assert_inherited_teardown([:custom_teardown_method3,
80
- :custom_teardown_method0,
81
- :custom_teardown_method1,
82
- :teardown],
83
- test_case)
84
- assert_inherited_teardown([:teardown], nil)
85
- end
86
-
87
- def test_teardown_with_after_option
88
- test_case = assert_teardown([:teardown,
89
- :custom_teardown_method3,
90
- :custom_teardown_method0,
91
- :custom_teardown_method1],
92
- [[{:after => :append}],
93
- [{:after => :append}],
94
- [{:after => :prepend}],
95
- [{:after => :prepend}]])
96
- assert_inherited_teardown([:teardown,
97
- :custom_teardown_method3,
98
- :custom_teardown_method0,
99
- :custom_teardown_method1],
100
- test_case)
101
- assert_inherited_teardown([:teardown], nil)
102
- end
103
-
104
- def test_teardown_with_invalid_option
105
- assert_invalid_teardown_option(:unknown => true)
106
- assert_invalid_teardown_option(:before => :unknown)
107
- assert_invalid_teardown_option(:after => :unknown)
108
- end
109
-
110
- private
111
- def assert_setup(expected, setup_options)
112
- called = []
113
- test_case = Class.new(Test::Unit::TestCase) do
114
- @@called = called
115
- def setup
116
- @@called << :setup
117
- end
118
-
119
- setup(*(setup_options[0] || []))
120
- def custom_setup_method0
121
- @@called << :custom_setup_method0
122
- end
123
-
124
- def custom_setup_method1
125
- @@called << :custom_setup_method1
126
- end
127
- setup(*[:custom_setup_method1, *(setup_options[1] || [])])
128
-
129
- setup(*(setup_options[2] || []))
130
- def custom_setup_method2
131
- @@called << :custom_setup_method2
132
- end
133
- unregister_setup(:custom_setup_method2)
134
-
135
- setup(*(setup_options[3] || []))
136
- def custom_setup_method3
137
- @@called << :custom_setup_method3
138
- end
139
-
140
- def test_nothing
141
- end
142
- end
143
-
144
- test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
145
- assert_equal(expected, called)
146
- test_case
147
- end
148
-
149
- def assert_inherited_setup(expected, parent)
150
- called = []
151
- inherited_test_case = Class.new(parent || Test::Unit::TestCase) do
152
- @@called = called
153
- def setup
154
- @@called << :setup
155
- end
156
-
157
- def custom_setup_method0
158
- @@called << :custom_setup_method0
159
- end
160
-
161
- def custom_setup_method1
162
- @@called << :custom_setup_method1
163
- end
164
-
165
- def custom_setup_method2
166
- @@called << :custom_setup_method2
167
- end
168
-
169
- def custom_setup_method3
170
- @@called << :custom_setup_method3
171
- end
172
-
173
- def test_nothing
174
- end
175
- end
176
-
177
- inherited_test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
178
- assert_equal(expected, called)
179
- end
180
-
181
- def assert_teardown(expected, teardown_options)
182
- called = []
183
- test_case = Class.new(Test::Unit::TestCase) do
184
- @@called = called
185
- def teardown
186
- @@called << :teardown
187
- end
188
-
189
- teardown(*(teardown_options[0] || []))
190
- def custom_teardown_method0
191
- @@called << :custom_teardown_method0
192
- end
193
-
194
- def custom_teardown_method1
195
- @@called << :custom_teardown_method1
196
- end
197
- teardown(*[:custom_teardown_method1, *(teardown_options[1] || [])])
198
-
199
- teardown(*(teardown_options[2] || []))
200
- def custom_teardown_method2
201
- @@called << :custom_teardown_method2
202
- end
203
- unregister_teardown(:custom_teardown_method2)
204
-
205
- teardown(*(teardown_options[3] || []))
206
- def custom_teardown_method3
207
- @@called << :custom_teardown_method3
208
- end
209
-
210
- def test_nothing
211
- end
212
- end
213
-
214
- test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
215
- assert_equal(expected, called)
216
- test_case
217
- end
218
-
219
- def assert_inherited_teardown(expected, parent)
220
- called = []
221
- inherited_test_case = Class.new(parent || Test::Unit::TestCase) do
222
- @@called = called
223
- def teardown
224
- @@called << :teardown
225
- end
226
-
227
- def custom_teardown_method0
228
- @@called << :custom_teardown_method0
229
- end
230
-
231
- def custom_teardown_method1
232
- @@called << :custom_teardown_method1
233
- end
234
-
235
- def custom_teardown_method2
236
- @@called << :custom_teardown_method2
237
- end
238
-
239
- def custom_teardown_method3
240
- @@called << :custom_teardown_method3
241
- end
242
-
243
- def test_nothing
244
- end
245
- end
246
-
247
- inherited_test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
248
- assert_equal(expected, called)
249
- end
250
-
251
- def assert_invalid_option(fixture_type, option)
252
- exception = assert_raise(ArgumentError) do
253
- Class.new(Test::Unit::TestCase) do
254
- def test_nothing
255
- end
256
-
257
- send(fixture_type, option)
258
- def fixture
259
- end
260
- end
261
- end
262
- assert_equal("must be {:before => :prepend}, {:before => :append}, " +
263
- "{:after => :prepend} or {:after => :append}" +
264
- ": #{option.inspect}",
265
- exception.message)
266
- end
267
-
268
- def assert_invalid_setup_option(option)
269
- assert_invalid_option(:setup, option)
270
- end
271
-
272
- def assert_invalid_teardown_option(option)
273
- assert_invalid_option(:teardown, option)
274
- end
275
- end