activeldap 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. data/CHANGES +24 -0
  2. data/README +9 -3
  3. data/Rakefile +24 -50
  4. data/examples/al-admin/Rakefile +6 -0
  5. data/examples/al-admin/app/controllers/application_controller.rb +9 -2
  6. data/examples/al-admin/config/environment.rb +9 -3
  7. data/examples/al-admin/config/initializers/fast_gettext.rb +3 -0
  8. data/examples/al-admin/config/session_secret.txt +1 -1
  9. data/lib/active_ldap.rb +6 -19
  10. data/lib/active_ldap/adapter/base.rb +22 -20
  11. data/lib/active_ldap/adapter/jndi.rb +2 -3
  12. data/lib/active_ldap/adapter/jndi_connection.rb +2 -2
  13. data/lib/active_ldap/adapter/ldap.rb +9 -4
  14. data/lib/active_ldap/adapter/net_ldap.rb +5 -4
  15. data/lib/active_ldap/base.rb +1 -1
  16. data/lib/active_ldap/get_text.rb +2 -2
  17. data/lib/active_ldap/get_text_fallback.rb +39 -32
  18. data/lib/active_ldap/get_text_support.rb +4 -2
  19. data/lib/active_ldap/operations.rb +3 -2
  20. data/lib/active_ldap/validations.rb +11 -21
  21. data/po/en/active-ldap.po +9 -9
  22. data/po/ja/active-ldap.po +18 -18
  23. data/test/run-test.rb +7 -1
  24. data/test/test_adapter.rb +1 -0
  25. data/test/test_base.rb +8 -1
  26. data/test/test_load.rb +2 -1
  27. data/test/test_user.rb +3 -4
  28. data/test/test_validation.rb +20 -23
  29. metadata +34 -228
  30. data/data/locale/en/LC_MESSAGES/active-ldap.mo +0 -0
  31. data/data/locale/ja/LC_MESSAGES/active-ldap.mo +0 -0
  32. data/examples/al-admin/config/initializers/gettext.rb +0 -1
  33. data/examples/al-admin/lib/tasks/gettext.rake +0 -36
  34. data/examples/al-admin/locale/en/LC_MESSAGES/al-admin.mo +0 -0
  35. data/examples/al-admin/locale/ja/LC_MESSAGES/al-admin.mo +0 -0
  36. data/examples/al-admin/locale/nl/LC_MESSAGES/al-admin.mo +0 -0
  37. data/examples/al-admin/po/al-admin.pot +0 -344
  38. data/examples/al-admin/public/images/active-ldap.png +0 -0
  39. data/examples/al-admin/vendor/locale_rails/.gitignore +0 -6
  40. data/examples/al-admin/vendor/locale_rails/COPYING +0 -56
  41. data/examples/al-admin/vendor/locale_rails/ChangeLog +0 -35
  42. data/examples/al-admin/vendor/locale_rails/README.rdoc +0 -62
  43. data/examples/al-admin/vendor/locale_rails/Rakefile +0 -73
  44. data/examples/al-admin/vendor/locale_rails/lib/locale_rails.rb +0 -18
  45. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller.rb +0 -15
  46. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/base.rb +0 -82
  47. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/caching.rb +0 -51
  48. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/test_process.rb +0 -44
  49. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_view.rb +0 -53
  50. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/i18n.rb +0 -67
  51. data/examples/al-admin/vendor/locale_rails/lib/locale_rails/version.rb +0 -4
  52. data/examples/al-admin/vendor/locale_rails/sample/README +0 -22
  53. data/examples/al-admin/vendor/locale_rails/sample/Rakefile +0 -10
  54. data/examples/al-admin/vendor/locale_rails/sample/app/controllers/application.rb +0 -42
  55. data/examples/al-admin/vendor/locale_rails/sample/app/controllers/samples_controller.rb +0 -30
  56. data/examples/al-admin/vendor/locale_rails/sample/app/helpers/application_helper.rb +0 -3
  57. data/examples/al-admin/vendor/locale_rails/sample/app/views/layouts/samples.html.erb +0 -20
  58. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/_part.html.erb +0 -68
  59. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/_part_nl.html.erb +0 -2
  60. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/cached_action.html.erb +0 -6
  61. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index.html.erb +0 -33
  62. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index.pt.html.erb +0 -16
  63. data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index_uz_UZ.html.erb +0 -16
  64. data/examples/al-admin/vendor/locale_rails/sample/config/boot.rb +0 -109
  65. data/examples/al-admin/vendor/locale_rails/sample/config/environment.rb +0 -25
  66. data/examples/al-admin/vendor/locale_rails/sample/config/environments/development.rb +0 -17
  67. data/examples/al-admin/vendor/locale_rails/sample/config/environments/production.rb +0 -24
  68. data/examples/al-admin/vendor/locale_rails/sample/config/environments/test.rb +0 -22
  69. data/examples/al-admin/vendor/locale_rails/sample/config/initializers/inflections.rb +0 -10
  70. data/examples/al-admin/vendor/locale_rails/sample/config/initializers/mime_types.rb +0 -5
  71. data/examples/al-admin/vendor/locale_rails/sample/config/initializers/new_rails_defaults.rb +0 -17
  72. data/examples/al-admin/vendor/locale_rails/sample/config/locales/en.yml +0 -2
  73. data/examples/al-admin/vendor/locale_rails/sample/config/locales/ja.yml +0 -2
  74. data/examples/al-admin/vendor/locale_rails/sample/config/routes.rb +0 -13
  75. data/examples/al-admin/vendor/locale_rails/sample/db/schema.rb +0 -10
  76. data/examples/al-admin/vendor/locale_rails/sample/public/404.html +0 -30
  77. data/examples/al-admin/vendor/locale_rails/sample/public/422.html +0 -30
  78. data/examples/al-admin/vendor/locale_rails/sample/public/500.html +0 -33
  79. data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.cgi +0 -10
  80. data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.fcgi +0 -24
  81. data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.rb +0 -10
  82. data/examples/al-admin/vendor/locale_rails/sample/public/favicon.ico +0 -0
  83. data/examples/al-admin/vendor/locale_rails/sample/public/images/rails.png +0 -0
  84. data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/application.js +0 -2
  85. data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/controls.js +0 -963
  86. data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/dragdrop.js +0 -972
  87. data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/effects.js +0 -1120
  88. data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/prototype.js +0 -4221
  89. data/examples/al-admin/vendor/locale_rails/sample/public/robots.txt +0 -5
  90. data/examples/al-admin/vendor/locale_rails/sample/public/stylesheets/locale.css +0 -81
  91. data/examples/al-admin/vendor/locale_rails/sample/public/stylesheets/scaffold.css +0 -74
  92. data/examples/al-admin/vendor/locale_rails/sample/script/about +0 -4
  93. data/examples/al-admin/vendor/locale_rails/sample/script/console +0 -3
  94. data/examples/al-admin/vendor/locale_rails/sample/script/dbconsole +0 -3
  95. data/examples/al-admin/vendor/locale_rails/sample/script/destroy +0 -3
  96. data/examples/al-admin/vendor/locale_rails/sample/script/generate +0 -3
  97. data/examples/al-admin/vendor/locale_rails/sample/script/performance/benchmarker +0 -3
  98. data/examples/al-admin/vendor/locale_rails/sample/script/performance/profiler +0 -3
  99. data/examples/al-admin/vendor/locale_rails/sample/script/performance/request +0 -3
  100. data/examples/al-admin/vendor/locale_rails/sample/script/plugin +0 -3
  101. data/examples/al-admin/vendor/locale_rails/sample/script/process/inspector +0 -3
  102. data/examples/al-admin/vendor/locale_rails/sample/script/process/reaper +0 -3
  103. data/examples/al-admin/vendor/locale_rails/sample/script/process/spawner +0 -3
  104. data/examples/al-admin/vendor/locale_rails/sample/script/runner +0 -3
  105. data/examples/al-admin/vendor/locale_rails/sample/script/server +0 -3
  106. data/examples/al-admin/vendor/locale_rails/sample/test/performance/browsing_test.rb +0 -9
  107. data/examples/al-admin/vendor/locale_rails/sample/test/test_helper.rb +0 -38
  108. data/examples/al-admin/vendor/locale_rails/test/README +0 -243
  109. data/examples/al-admin/vendor/locale_rails/test/Rakefile +0 -10
  110. data/examples/al-admin/vendor/locale_rails/test/app/controllers/application_controller.rb +0 -10
  111. data/examples/al-admin/vendor/locale_rails/test/app/controllers/articles_controller.rb +0 -17
  112. data/examples/al-admin/vendor/locale_rails/test/app/helpers/application_helper.rb +0 -3
  113. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index.html.erb +0 -1
  114. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_de.html.erb +0 -1
  115. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_fr_FR.html.erb +0 -1
  116. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_ja.html.erb +0 -1
  117. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/list.html.erb +0 -1
  118. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/show.html.erb +0 -0
  119. data/examples/al-admin/vendor/locale_rails/test/app/views/articles/show.js.rjs +0 -0
  120. data/examples/al-admin/vendor/locale_rails/test/config/boot.rb +0 -110
  121. data/examples/al-admin/vendor/locale_rails/test/config/environment.rb +0 -42
  122. data/examples/al-admin/vendor/locale_rails/test/config/environments/development.rb +0 -17
  123. data/examples/al-admin/vendor/locale_rails/test/config/environments/production.rb +0 -28
  124. data/examples/al-admin/vendor/locale_rails/test/config/environments/test.rb +0 -35
  125. data/examples/al-admin/vendor/locale_rails/test/config/initializers/backtrace_silencers.rb +0 -7
  126. data/examples/al-admin/vendor/locale_rails/test/config/initializers/inflections.rb +0 -10
  127. data/examples/al-admin/vendor/locale_rails/test/config/initializers/mime_types.rb +0 -5
  128. data/examples/al-admin/vendor/locale_rails/test/config/initializers/new_rails_defaults.rb +0 -19
  129. data/examples/al-admin/vendor/locale_rails/test/config/initializers/session_store.rb +0 -15
  130. data/examples/al-admin/vendor/locale_rails/test/config/locales/en.yml +0 -5
  131. data/examples/al-admin/vendor/locale_rails/test/config/routes.rb +0 -46
  132. data/examples/al-admin/vendor/locale_rails/test/db/schema.rb +0 -0
  133. data/examples/al-admin/vendor/locale_rails/test/public/404.html +0 -30
  134. data/examples/al-admin/vendor/locale_rails/test/public/422.html +0 -30
  135. data/examples/al-admin/vendor/locale_rails/test/public/500.html +0 -30
  136. data/examples/al-admin/vendor/locale_rails/test/public/favicon.ico +0 -0
  137. data/examples/al-admin/vendor/locale_rails/test/public/images/rails.png +0 -0
  138. data/examples/al-admin/vendor/locale_rails/test/public/index.html +0 -275
  139. data/examples/al-admin/vendor/locale_rails/test/public/javascripts/application.js +0 -2
  140. data/examples/al-admin/vendor/locale_rails/test/public/javascripts/controls.js +0 -963
  141. data/examples/al-admin/vendor/locale_rails/test/public/javascripts/dragdrop.js +0 -973
  142. data/examples/al-admin/vendor/locale_rails/test/public/javascripts/effects.js +0 -1128
  143. data/examples/al-admin/vendor/locale_rails/test/public/javascripts/prototype.js +0 -4320
  144. data/examples/al-admin/vendor/locale_rails/test/public/robots.txt +0 -5
  145. data/examples/al-admin/vendor/locale_rails/test/script/about +0 -4
  146. data/examples/al-admin/vendor/locale_rails/test/script/console +0 -3
  147. data/examples/al-admin/vendor/locale_rails/test/script/dbconsole +0 -3
  148. data/examples/al-admin/vendor/locale_rails/test/script/destroy +0 -3
  149. data/examples/al-admin/vendor/locale_rails/test/script/generate +0 -3
  150. data/examples/al-admin/vendor/locale_rails/test/script/performance/benchmarker +0 -3
  151. data/examples/al-admin/vendor/locale_rails/test/script/performance/profiler +0 -3
  152. data/examples/al-admin/vendor/locale_rails/test/script/plugin +0 -3
  153. data/examples/al-admin/vendor/locale_rails/test/script/runner +0 -3
  154. data/examples/al-admin/vendor/locale_rails/test/script/server +0 -3
  155. data/examples/al-admin/vendor/locale_rails/test/test/functional/articles_controller_test.rb +0 -161
  156. data/examples/al-admin/vendor/locale_rails/test/test/performance/browsing_test.rb +0 -9
  157. data/examples/al-admin/vendor/locale_rails/test/test/test_helper.rb +0 -38
  158. data/po/active-ldap.pot +0 -4010
  159. data/test-unit/COPYING +0 -56
  160. data/test-unit/GPL +0 -340
  161. data/test-unit/History.txt +0 -223
  162. data/test-unit/Manifest.txt +0 -87
  163. data/test-unit/PSFL +0 -271
  164. data/test-unit/README.txt +0 -60
  165. data/test-unit/Rakefile +0 -40
  166. data/test-unit/TODO +0 -5
  167. data/test-unit/bin/testrb +0 -5
  168. data/test-unit/images/color-diff.png +0 -0
  169. data/test-unit/lib/test/unit.rb +0 -328
  170. data/test-unit/lib/test/unit/assertionfailederror.rb +0 -25
  171. data/test-unit/lib/test/unit/assertions.rb +0 -1334
  172. data/test-unit/lib/test/unit/attribute.rb +0 -125
  173. data/test-unit/lib/test/unit/autorunner.rb +0 -360
  174. data/test-unit/lib/test/unit/collector.rb +0 -36
  175. data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
  176. data/test-unit/lib/test/unit/collector/dir.rb +0 -108
  177. data/test-unit/lib/test/unit/collector/load.rb +0 -144
  178. data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
  179. data/test-unit/lib/test/unit/color-scheme.rb +0 -106
  180. data/test-unit/lib/test/unit/color.rb +0 -96
  181. data/test-unit/lib/test/unit/diff.rb +0 -740
  182. data/test-unit/lib/test/unit/error.rb +0 -130
  183. data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
  184. data/test-unit/lib/test/unit/failure.rb +0 -136
  185. data/test-unit/lib/test/unit/fixture.rb +0 -176
  186. data/test-unit/lib/test/unit/notification.rb +0 -129
  187. data/test-unit/lib/test/unit/omission.rb +0 -191
  188. data/test-unit/lib/test/unit/pending.rb +0 -150
  189. data/test-unit/lib/test/unit/priority.rb +0 -180
  190. data/test-unit/lib/test/unit/runner/console.rb +0 -52
  191. data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
  192. data/test-unit/lib/test/unit/runner/tap.rb +0 -8
  193. data/test-unit/lib/test/unit/testcase.rb +0 -478
  194. data/test-unit/lib/test/unit/testresult.rb +0 -89
  195. data/test-unit/lib/test/unit/testsuite.rb +0 -110
  196. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
  197. data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -466
  198. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -63
  199. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +0 -92
  200. data/test-unit/lib/test/unit/ui/testrunner.rb +0 -28
  201. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
  202. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
  203. data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -42
  204. data/test-unit/lib/test/unit/util/method-owner-finder.rb +0 -28
  205. data/test-unit/lib/test/unit/util/observable.rb +0 -90
  206. data/test-unit/lib/test/unit/util/output.rb +0 -31
  207. data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
  208. data/test-unit/lib/test/unit/version.rb +0 -7
  209. data/test-unit/sample/adder.rb +0 -13
  210. data/test-unit/sample/subtracter.rb +0 -12
  211. data/test-unit/sample/test_adder.rb +0 -20
  212. data/test-unit/sample/test_subtracter.rb +0 -20
  213. data/test-unit/sample/test_user.rb +0 -23
  214. data/test-unit/test/collector/test-descendant.rb +0 -133
  215. data/test-unit/test/collector/test-load.rb +0 -442
  216. data/test-unit/test/collector/test_dir.rb +0 -406
  217. data/test-unit/test/collector/test_objectspace.rb +0 -100
  218. data/test-unit/test/run-test.rb +0 -15
  219. data/test-unit/test/test-attribute.rb +0 -86
  220. data/test-unit/test/test-color-scheme.rb +0 -69
  221. data/test-unit/test/test-color.rb +0 -47
  222. data/test-unit/test/test-diff.rb +0 -518
  223. data/test-unit/test/test-emacs-runner.rb +0 -60
  224. data/test-unit/test/test-fixture.rb +0 -287
  225. data/test-unit/test/test-notification.rb +0 -33
  226. data/test-unit/test/test-omission.rb +0 -81
  227. data/test-unit/test/test-pending.rb +0 -70
  228. data/test-unit/test/test-priority.rb +0 -119
  229. data/test-unit/test/test-testcase.rb +0 -544
  230. data/test-unit/test/test_assertions.rb +0 -1197
  231. data/test-unit/test/test_error.rb +0 -26
  232. data/test-unit/test/test_failure.rb +0 -33
  233. data/test-unit/test/test_testresult.rb +0 -113
  234. data/test-unit/test/test_testsuite.rb +0 -129
  235. data/test-unit/test/testunit-test-util.rb +0 -14
  236. data/test-unit/test/ui/test_testrunmediator.rb +0 -20
  237. data/test-unit/test/util/test-method-owner-finder.rb +0 -38
  238. data/test-unit/test/util/test-output.rb +0 -11
  239. data/test-unit/test/util/test_backtracefilter.rb +0 -41
  240. data/test-unit/test/util/test_observable.rb +0 -102
  241. data/test-unit/test/util/test_procwrapper.rb +0 -36
data/CHANGES CHANGED
@@ -1,5 +1,29 @@
1
1
  = CHANGES
2
2
 
3
+ == 1.2.3: 2011-04-30
4
+
5
+ * [#40] Ignored nil value attribute.
6
+ [christian.pennafort]
7
+ * [#48] Escaped ":" in filter value.
8
+ [planetmcd]
9
+ * Added missing rubygems require.
10
+ [spoidar]
11
+ * Used fast_gettext instead of gettext.
12
+ [Peter Fern]
13
+ * Supported Rails 2.3.11.
14
+ [Kris Wehner]
15
+ * Fixed wrong assertion in test.
16
+ [Ryan Tandy]
17
+
18
+ === Thanks
19
+
20
+ * christian.pennafort
21
+ * planetmcd
22
+ * spoidar
23
+ * Peter Fern
24
+ * Kris Wehner
25
+ * Ryan Tandy
26
+
3
27
  == 1.2.2: 2010-07-04
4
28
 
5
29
  * Supported ActiveRecord 2.3.8 and Rails 2.3.8.
data/README CHANGED
@@ -3,7 +3,7 @@
3
3
  ruby library for object-oriented LDAP interction
4
4
 
5
5
  * Copyright (C) 2004-2006 Will Drewry <tt><will@alum.bu.edu></tt>
6
- * Copyright (C) 2006-2009 Kouhei Sutou <tt><kou@clear-code.com></tt>
6
+ * Copyright (C) 2006-2011 Kouhei Sutou <tt><kou@clear-code.com></tt>
7
7
 
8
8
  Contributors::
9
9
  * Dick Davies <tt><rasputnik AT hellooperator.net></tt>
@@ -90,7 +90,9 @@ list, please point out.
90
90
  * Nobody: Bug reports and API improveent ideas.
91
91
  * James Hughes: Bug reports and advices and documentations.
92
92
  * Buzz Chopra: Documentations.
93
- * Christoph Lipp: Bug reports.
93
+ * Christoph Lipp:
94
+ * Bug reports.
95
+ * Tell us character escape syntax.
94
96
  * Jeff Hall: Bug reports.
95
97
  * Ernie Miller: Bug reports and advices.
96
98
  * Daniel Pfile: Patches.
@@ -99,7 +101,6 @@ list, please point out.
99
101
  * Bug reports.
100
102
  * Nederlands translations.
101
103
  * Iain Pople: Bug reports and API improvement ideas.
102
- * Christoph Lipp: Tell us character escape syntax.
103
104
  * Kevin McCarthy: Patches.
104
105
  * Perry Smith: Patches, bug reports and indications.
105
106
  * Marc Dequènes: API suggestions.
@@ -146,3 +147,8 @@ list, please point out.
146
147
  * Anthony M. Martinez: Helped SASL options support
147
148
  * ilusi0n.x: A bug report.
148
149
  * projekttabla: A suggestion.
150
+ * christian.pennaforte: A bug report.
151
+ * planetmcd: A bug report.
152
+ * spoidar: Rails 3 support.
153
+ * Kris Wehner: Rails 2.3.8 support.
154
+ * Ryan Tandy: A test bug fix.
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # -*- ruby -*-
2
2
 
3
+ require 'thread'
3
4
  require 'rubygems'
4
5
  require 'hoe'
5
6
  require 'find'
@@ -16,7 +17,7 @@ manifest = File.join(base_dir, "Manifest.txt")
16
17
  manifest_contents = []
17
18
  base_dir_included_components = %w(CHANGES COPYING LICENSE Manifest.txt
18
19
  README Rakefile TODO)
19
- excluded_components = %w(.svn .test-result .config doc log tmp
20
+ excluded_components = %w(.svn .git .test-result .config doc log tmp
20
21
  pkg html config.yaml database.yml ldap.yml)
21
22
  excluded_suffixes = %w(.help .sqlite3)
22
23
  white_list_paths =
@@ -53,9 +54,10 @@ at_exit do
53
54
  FileUtils.rm_f("History.txt")
54
55
  end
55
56
 
56
- ENV["VERSION"] = ActiveLdap::VERSION
57
+ ENV["VERSION"] ||= ActiveLdap::VERSION
58
+ version = ENV["VERSION"]
57
59
  project = Hoe.spec('activeldap') do
58
- self.version = ActiveLdap::VERSION
60
+ self.version = version
59
61
  self.rubyforge_name = 'ruby-activeldap'
60
62
  self.author = ['Will Drewry', 'Kouhei Sutou']
61
63
  self.email = ['redpig@dataspill.org', 'kou@cozmixng.org']
@@ -66,10 +68,10 @@ project = Hoe.spec('activeldap') do
66
68
  self.extra_deps = [
67
69
  # ['ruby-ldap', '= 0.9.9'],
68
70
  # ['net-ldap', '= 0.1.1'],
69
- ['activerecord', '= 2.3.8'],
71
+ ['activerecord', '~> 2.3.11'],
70
72
  ['locale', '= 2.0.5'],
71
- ['gettext', '= 2.1.0'],
72
- ['gettext_activerecord', '= 2.1.0'],
73
+ ['fast_gettext', '= 0.5.8'],
74
+ ['gettext_i18n_rails', '= 0.2.2'],
73
75
  ]
74
76
  self.remote_rdoc_dir = "doc"
75
77
  self.rsync_args += " --chmod=Dg+ws,Fg+w"
@@ -106,54 +108,26 @@ ObjectSpace.each_object(Rake::RDocTask) do |task|
106
108
  task.rdoc_files = project.spec.require_paths + project.spec.extra_rdoc_files
107
109
  end
108
110
 
109
- desc 'Tag the repository for release.'
110
- task :tag do
111
- system "svn copy -m 'New release tag' https://ruby-activeldap.googlecode.com/svn/trunk https://ruby-activeldap.googlecode.com/svn/tags/r#{ActiveLdap::VERSION}"
111
+ begin
112
+ require "gettext_i18n_rails/tasks"
113
+ rescue LoadError
114
+ puts "gettext_i18n_rails is not installed, you probably should run 'rake gems:install' or 'bundle install'."
112
115
  end
113
116
 
117
+ desc "Publish HTML to Web site."
118
+ task :publish_html do
119
+ config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
120
+ host = "#{config["username"]}@rubyforge.org"
114
121
 
115
- desc "Update *.po/*.pot files and create *.mo from *.po files"
116
- task :gettext => ["gettext:po:update", "gettext:mo:create"]
117
-
118
- namespace :gettext do
119
- desc "Setup environment for GetText"
120
- task :environment do
121
- require "gettext/tools"
122
- end
123
-
124
- namespace :po do
125
- desc "Update po/pot files (GetText)"
126
- task :update => "gettext:environment" do
127
- require 'active_ldap/get_text/parser'
128
- dummy_file = "@@@dummy-for-active-ldap@@@"
129
- parser = Object.new
130
- parser.instance_eval do
131
- @parser = ActiveLdap::GetText::Parser.new
132
- @dummy_file = dummy_file
133
- end
134
- def parser.target?(file)
135
- file == @dummy_file
136
- end
137
- def parser.parse(file, targets)
138
- @parser.extract_all_in_schema(targets)
139
- end
140
-
141
- GetText::RGetText.add_parser(parser)
142
- files = [dummy_file] + Dir.glob("{lib,rails,benchmark}/**/*.rb")
143
- GetText.update_pofiles("active-ldap",
144
- files,
145
- "Ruby/ActiveLdap #{ActiveLdap::VERSION}")
146
- end
147
- end
148
-
149
- namespace :mo do
150
- desc "Create *.mo from *.po (GetText)"
151
- task :create => "gettext:environment" do
152
- GetText.create_mofiles
153
- end
154
- end
122
+ rsync_args = "-av --exclude '*.erb' --exclude '*.svg' --exclude .svn"
123
+ remote_dir = "/var/www/gforge-projects/#{project.rubyforge_name}/"
124
+ sh "rsync #{rsync_args} html/ #{host}:#{remote_dir}"
155
125
  end
156
126
 
157
- task(:gem).prerequisites.unshift("gettext:mo:create")
127
+ desc "Tag the current revision."
128
+ task :tag do
129
+ message = "Released ActiveLdap #{version}!"
130
+ sh 'git', 'tag', '-a', version, '-m', message
131
+ end
158
132
 
159
133
  # vim: syntax=ruby
@@ -7,4 +7,10 @@ require 'rake'
7
7
  require 'rake/testtask'
8
8
  require 'rake/rdoctask'
9
9
 
10
+ begin
11
+ require "gettext_i18n_rails/tasks"
12
+ rescue LoadError
13
+ puts "gettext_i18n_rails is not installed, you probably should run 'rake gems:install'."
14
+ end
15
+
10
16
  require 'tasks/rails'
@@ -8,13 +8,14 @@ class ApplicationController < ActionController::Base
8
8
  # Uncomment the :secret if you're not using the cookie session store
9
9
  protect_from_forgery # :secret => '5965eefc93d824a9c145fe8edb6d1a36'
10
10
 
11
- init_gettext "al-admin"
12
-
13
11
  include ExceptionNotifiable
14
12
 
15
13
  include AuthenticatedSystem
14
+
16
15
  before_filter :login_from_cookie
17
16
 
17
+ before_filter :set_gettext_locale
18
+
18
19
  filter_parameter_logging :password, :password_confirmation
19
20
 
20
21
  private
@@ -36,4 +37,10 @@ class ApplicationController < ActionController::Base
36
37
  def authorized?
37
38
  current_ldap_user.connected?
38
39
  end
40
+
41
+ def set_gettext_locale
42
+ FastGettext.text_domain = 'al-admin'
43
+ FastGettext.available_locales = ['en', 'ja', 'nl']
44
+ super
45
+ end
39
46
  end
@@ -28,7 +28,14 @@ Rails::Initializer.run do |config|
28
28
  # config.gem "sqlite3-ruby", :lib => "sqlite3"
29
29
  # config.gem "aws-s3", :lib => "aws/s3"
30
30
  # config.gem "locale_rails", :version => "2.0.5"
31
- config.gem "gettext_rails", :version => "2.1.0"
31
+ # config.gem "gettext_rails", :version => "2.1.0"
32
+ config.gem "fast_gettext", :version => '>=0.5.8'
33
+ #only used for mo/po file generation in development, !do not load(:lib=>false), will needlessly eat ram!
34
+ config.gem "gettext", :lib => false, :version => '>=2.1.0'
35
+ #this is needed for language/country translations
36
+ config.gem "gettext_i18n_rails", :version => '>=0.2.2'
37
+ #this is needed for language/country translations
38
+ config.gem "i18n_data", :version => '>=0.2.3'
32
39
 
33
40
  # Only load the plugins named here, in the order given. By default, all plugins
34
41
  # in vendor/plugins are loaded in alphabetical order.
@@ -37,8 +44,7 @@ Rails::Initializer.run do |config|
37
44
 
38
45
  # Add additional load paths for your own custom dirs
39
46
  # config.load_paths += %W( #{RAILS_ROOT}/extras )
40
- config.load_paths += ["#{RAILS_ROOT}/../../lib",
41
- "#{RAILS_ROOT}/vendor/locale_rails/lib"]
47
+ config.load_paths += ["#{RAILS_ROOT}/../../lib"]
42
48
  config.plugin_paths += %W(#{RAILS_ROOT}/../..)
43
49
 
44
50
  # Force all environments to use the same logger level
@@ -0,0 +1,3 @@
1
+ FastGettext.add_text_domain 'al-admin', :path => 'po'
2
+ FastGettext.default_available_locales = ['en','ja','nl'] #all you want to allow
3
+ FastGettext.default_text_domain = 'al-admin'
@@ -1 +1 @@
1
- 23aa39bc18aa4a5d9adc7e060acd5e8c196d5c8261c8ebbe675b0973ca3b8dce836950b4de879f6f70e6240df94868bc967af33cd6f69ec7bed15f9f6c80291f
1
+ ebcc497433c106b5b66580c617c287f8e771a290bfcc015c81015dd1b11b35c56d913c09abdb77200f7776faab0636cff0f0d8293bd10619226b6930320b9763
@@ -1,4 +1,3 @@
1
- #!/usr/bin/ruby
2
1
  # = ActiveLdap
3
2
  #
4
3
  # Copyright (C) 2004,2005 Will Drewry mailto:will@alum.bu.edu
@@ -888,10 +887,6 @@
888
887
  # package, and I'd like to see it prove helpful to more people than just myself.
889
888
  #
890
889
 
891
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "..", "net-ldap", "lib"))
892
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "..", "ldap", "lib"))
893
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "..", "ldap"))
894
-
895
890
  require_gem_if_need = Proc.new do |library_name, gem_name, *gem_args|
896
891
  gem_name ||= library_name
897
892
  begin
@@ -906,20 +901,13 @@ require_gem_if_need = Proc.new do |library_name, gem_name, *gem_args|
906
901
  end
907
902
  end
908
903
 
909
- require_gem_if_need.call("active_support", "activesupport", "= 2.3.8")
904
+ require_gem_if_need.call("active_support", "activesupport", "~> 2.3.11")
910
905
 
911
- if ActiveSupport.const_defined?(:Dependencies)
912
- dependencies = ActiveSupport::Dependencies
913
- else
914
- dependencies = Dependencies
915
- end
916
-
917
- if dependencies.respond_to?(:load_paths)
918
- dependencies.load_paths << File.expand_path(File.dirname(__FILE__))
919
- end
906
+ # TODO: This should be removed when Rails 3 is supported.
907
+ ActiveSupport::Dependencies.autoload_paths << File.expand_path(File.dirname(__FILE__))
920
908
 
921
909
  module ActiveLdap
922
- VERSION = "1.2.2"
910
+ VERSION = "1.2.3"
923
911
  end
924
912
 
925
913
  if RUBY_PLATFORM.match('linux')
@@ -928,11 +916,10 @@ else
928
916
  require 'active_ldap/timeout_stub'
929
917
  end
930
918
 
931
- require_gem_if_need.call("active_record", "activerecord", "= 2.3.8")
919
+ require_gem_if_need.call("active_record", "activerecord", "~> 2.3.11")
932
920
  begin
933
921
  require_gem_if_need.call("locale", nil, "= 2.0.5")
934
- require_gem_if_need.call("gettext", nil, "= 2.1.0")
935
- require_gem_if_need.call("gettext_activerecord", nil, "= 2.1.0")
922
+ require_gem_if_need.call("fast_gettext", nil, "= 0.5.8")
936
923
  rescue LoadError
937
924
  end
938
925
  require 'active_ldap/get_text'
@@ -131,11 +131,15 @@ module ActiveLdap
131
131
  ]
132
132
  base ||= root_dse_values('subschemaSubentry', options)[0]
133
133
  base ||= 'cn=schema'
134
- dn, attributes = search(:base => base,
135
- :scope => :base,
136
- :filter => '(objectClass=subschema)',
137
- :attributes => attrs).first
138
- Schema.new(attributes)
134
+ schema = nil
135
+ search(:base => base,
136
+ :scope => :base,
137
+ :filter => '(objectClass=subschema)',
138
+ :attributes => attrs,
139
+ :limit => 1) do |dn, attributes|
140
+ schema = Schema.new(attributes)
141
+ end
142
+ schema || Schema.new([])
139
143
  end
140
144
  end
141
145
 
@@ -157,17 +161,10 @@ module ActiveLdap
157
161
  limit = nil if limit <= 0
158
162
 
159
163
  attrs = attrs.to_a # just in case
160
-
161
- values = []
162
- callback = Proc.new do |value, block|
163
- value = block.call(value) if block
164
- values << value
165
- end
166
-
167
164
  base = ensure_dn_string(base)
168
165
  begin
169
166
  operation(options) do
170
- yield(base, scope, filter, attrs, limit, callback)
167
+ yield(base, scope, filter, attrs, limit)
171
168
  end
172
169
  rescue LdapError::NoSuchObject, LdapError::InvalidDnSyntax
173
170
  # Do nothing on failure
@@ -176,8 +173,6 @@ module ActiveLdap
176
173
  _("Ignore error %s(%s): filter %s: attributes: %s") % args
177
174
  end
178
175
  end
179
-
180
- values
181
176
  end
182
177
 
183
178
  def delete(targets, options={})
@@ -318,7 +313,7 @@ module ActiveLdap
318
313
  n_retries = 0
319
314
  retry_limit = options[:retry_limit] || @retry_limit
320
315
  begin
321
- Timeout.alarm(@timeout, &block)
316
+ do_in_timeout(@timeout, &block)
322
317
  rescue Timeout::Error => e
323
318
  @logger.error {_('Requested action timed out.')}
324
319
  if @retry_on_timeout and retry_limit < 0 and n_retries <= retry_limit
@@ -333,6 +328,10 @@ module ActiveLdap
333
328
  end
334
329
  end
335
330
 
331
+ def do_in_timeout(timeout, &block)
332
+ Timeout.alarm(timeout, &block)
333
+ end
334
+
336
335
  def sasl_bind(bind_dn, options={})
337
336
  # Get all SASL mechanisms
338
337
  mechanisms = operation(options) do
@@ -503,7 +502,7 @@ module ActiveLdap
503
502
  when Time
504
503
  value = Schema::GeneralizedTime.new.normalize_value(value)
505
504
  end
506
- value.gsub(/(?:[()\\\0]|\*\*?)/) do |s|
505
+ value.gsub(/(?:[:()\\\0]|\*\*?)/) do |s|
507
506
  if s == "*"
508
507
  s
509
508
  else
@@ -622,7 +621,7 @@ module ActiveLdap
622
621
  end
623
622
 
624
623
  def root_dse_values(key, options={})
625
- dse = root_dse([key], options)[0]
624
+ dse = root_dse([key], options)
626
625
  return [] if dse.nil?
627
626
  normalized_key = key.downcase
628
627
  dse.each do |_key, _value|
@@ -632,11 +631,14 @@ module ActiveLdap
632
631
  end
633
632
 
634
633
  def root_dse(attrs, options={})
634
+ found_attributes = nil
635
635
  search(:base => "",
636
636
  :scope => :base,
637
- :attributes => attrs).collect do |dn, attributes|
638
- attributes
637
+ :attributes => attrs,
638
+ :limit => 1) do |dn, attributes|
639
+ found_attributes = attributes
639
640
  end
641
+ found_attributes
640
642
  end
641
643
 
642
644
  def construct_uri(host, port, ssl)
@@ -42,13 +42,12 @@ module ActiveLdap
42
42
  end
43
43
 
44
44
  def search(options={}, &block)
45
- super(options) do |base, scope, filter, attrs, limit, callback|
45
+ super(options) do |base, scope, filter, attrs, limit|
46
46
  info = {
47
47
  :base => base, :scope => scope_name(scope), :filter => filter,
48
48
  :attributes => attrs, :limit => limit,
49
49
  }
50
- execute(:search, info,
51
- base, scope, filter, attrs, limit, callback, &block)
50
+ execute(:search, info, base, scope, filter, attrs, limit, &block)
52
51
  end
53
52
  end
54
53
 
@@ -105,7 +105,7 @@ module ActiveLdap
105
105
  bound?
106
106
  end
107
107
 
108
- def search(base, scope, filter, attrs, limit, callback, &block)
108
+ def search(base, scope, filter, attrs, limit)
109
109
  controls = SearchControls.new
110
110
  controls.search_scope = scope
111
111
 
@@ -121,7 +121,7 @@ module ActiveLdap
121
121
  value.is_a?(String) ? value : String.from_java_bytes(value)
122
122
  end
123
123
  end
124
- callback.call([result.name_in_namespace, attributes], block)
124
+ yield([result.name_in_namespace, attributes])
125
125
  end
126
126
  end
127
127
 
@@ -79,8 +79,8 @@ module ActiveLdap
79
79
  end
80
80
  end
81
81
 
82
- def search(options={}, &block)
83
- super(options) do |base, scope, filter, attrs, limit, callback|
82
+ def search(options={})
83
+ super(options) do |base, scope, filter, attrs, limit|
84
84
  begin
85
85
  info = {
86
86
  :base => base, :scope => scope_name(scope),
@@ -90,9 +90,10 @@ module ActiveLdap
90
90
  info, base, scope, filter, attrs, limit) do |entry|
91
91
  attributes = {}
92
92
  entry.attrs.each do |attr|
93
- attributes[attr] = entry.vals(attr)
93
+ value = entry.vals(attr)
94
+ attributes[attr] = value if value
94
95
  end
95
- callback.call([entry.dn, attributes], block)
96
+ yield([entry.dn, attributes])
96
97
  end
97
98
  rescue RuntimeError
98
99
  if $!.message == "no result returned by search"
@@ -182,6 +183,10 @@ module ActiveLdap
182
183
  end
183
184
  end
184
185
 
186
+ def do_in_timeout(timeout, &block)
187
+ Timeout.timeout(timeout, &block)
188
+ end
189
+
185
190
  def ensure_method(method)
186
191
  normalized_method = method.to_s.downcase
187
192
  Method.constants.each do |name|