activesambaldap 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/NEWS.en +11 -3
  2. data/NEWS.ja +13 -2
  3. data/README.en +22 -3
  4. data/README.ja +21 -3
  5. data/Rakefile +38 -3
  6. data/bin/asl-groupadd +1 -1
  7. data/bin/asl-groupdel +3 -3
  8. data/bin/asl-groupmod +3 -3
  9. data/bin/asl-groupshow +1 -1
  10. data/bin/asl-passwd +1 -7
  11. data/bin/asl-populate +10 -10
  12. data/bin/asl-samba-computeradd +3 -3
  13. data/bin/asl-samba-groupadd +1 -1
  14. data/bin/asl-samba-groupdel +3 -3
  15. data/bin/asl-samba-groupmod +3 -3
  16. data/bin/asl-samba-useradd +3 -3
  17. data/bin/asl-samba-userdel +3 -3
  18. data/bin/asl-samba-usermod +3 -3
  19. data/bin/asl-useradd +4 -4
  20. data/bin/asl-userdel +3 -3
  21. data/bin/asl-usermod +3 -3
  22. data/bin/asl-usershow +1 -1
  23. data/lib/active_samba_ldap/{account.rb → account_entry.rb} +6 -1
  24. data/lib/active_samba_ldap/base.rb +8 -0
  25. data/lib/active_samba_ldap/command.rb +2 -0
  26. data/lib/active_samba_ldap/computer.rb +15 -4
  27. data/lib/active_samba_ldap/{computer_account.rb → computer_account_entry.rb} +2 -2
  28. data/lib/active_samba_ldap/configuration.rb +13 -4
  29. data/lib/active_samba_ldap/group.rb +7 -172
  30. data/lib/active_samba_ldap/group_entry.rb +188 -0
  31. data/lib/active_samba_ldap/populate.rb +7 -4
  32. data/lib/active_samba_ldap/{samba_account.rb → samba_account_entry.rb} +34 -9
  33. data/lib/active_samba_ldap/samba_entry.rb +26 -0
  34. data/lib/active_samba_ldap/{samba_group.rb → samba_group_entry.rb} +26 -10
  35. data/lib/active_samba_ldap/user.rb +33 -4
  36. data/lib/active_samba_ldap/{user_account.rb → user_account_entry.rb} +2 -2
  37. data/lib/active_samba_ldap/version.rb +1 -1
  38. data/lib/active_samba_ldap.rb +4 -2
  39. data/rails/plugin/active_samba_ldap/init.rb +1 -1
  40. data/test/asl-test-utils.rb +3 -3
  41. data/test/run-test.rb +2 -0
  42. data/test/test-unit-ext/priority.rb +4 -0
  43. metadata +17 -17
  44. data/lib/active_samba_ldap/configuration_files +0 -2
  45. data/lib/active_samba_ldap/samba_computer.rb +0 -20
  46. data/lib/active_samba_ldap/samba_user.rb +0 -39
@@ -1,14 +1,43 @@
1
+ require 'active_samba_ldap/base'
1
2
  require 'active_samba_ldap/entry'
2
- require 'active_samba_ldap/account'
3
- require 'active_samba_ldap/user_account'
3
+ require 'active_samba_ldap/samba_entry'
4
+ require 'active_samba_ldap/account_entry'
5
+ require 'active_samba_ldap/user_account_entry'
6
+ require 'active_samba_ldap/samba_account_entry'
4
7
 
5
8
  module ActiveSambaLdap
6
9
  class User < Base
7
10
  include Reloadable
8
11
 
9
12
  include Entry
13
+ include SambaEntry
10
14
 
11
- include Account
12
- include UserAccount
15
+ include AccountEntry
16
+ include UserAccountEntry
17
+ include SambaAccountEntry
18
+
19
+ def fill_default_values(options={})
20
+ result = super
21
+ return result unless samba_available?
22
+
23
+ subst = Proc.new do |key|
24
+ value = options[key]
25
+ if value
26
+ substitute_template(value)
27
+ else
28
+ substituted_value(key)
29
+ end
30
+ end
31
+
32
+ self.samba_home_path ||= subst[:user_home_unc]
33
+ self.samba_home_drive ||= subst[:user_home_drive].sub(/([^:])$/, "\\1:")
34
+ self.samba_profile_path ||= subst[:user_profile]
35
+ self.samba_logon_script ||= subst[:user_logon_script]
36
+ end
37
+
38
+ private
39
+ def default_account_flags
40
+ "[UH]"
41
+ end
13
42
  end
14
43
  end
@@ -1,6 +1,6 @@
1
1
  module ActiveSambaLdap
2
- module UserAccount
3
- NAME_RE = /\A#{Account::NAME_RE_SRC}\z/
2
+ module UserAccountEntry
3
+ NAME_RE = /\A#{AccountEntry::NAME_RE_SRC}\z/
4
4
 
5
5
  def self.included(base)
6
6
  super
@@ -1,3 +1,3 @@
1
1
  module ActiveSambaLdap
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3,12 +3,14 @@ require_gem_if_need = Proc.new do |library_name, gem_name, *options|
3
3
  require library_name
4
4
  rescue LoadError
5
5
  require 'rubygems'
6
- require_gem gem_name, *options
6
+ gem gem_name, *options
7
7
  require library_name
8
8
  end
9
9
  end
10
10
 
11
- require_gem_if_need.call("active_ldap", "ruby-activeldap", ">= 0.8.0")
11
+ required_active_ldap_version = ">= 0.8.2"
12
+ require_gem_if_need.call("active_ldap", "ruby-activeldap",
13
+ required_active_ldap_version)
12
14
 
13
15
  if Dependencies.respond_to?(:load_paths)
14
16
  Dependencies.load_paths << File.expand_path(File.dirname(__FILE__))
@@ -1,4 +1,4 @@
1
- require_dependency 'active_samba_ldap'
1
+ require_library_or_gem 'active_samba_ldap'
2
2
  ActiveSambaLdap::Base.logger ||= RAILS_DEFAULT_LOGGER
3
3
  ldap_configuration_file = File.join(RAILS_ROOT, 'config', 'ldap.yml')
4
4
  ActiveSambaLdap::Base.configurations =
@@ -85,11 +85,11 @@ module AslTestUtils
85
85
  module TemporaryEntry
86
86
  def setup
87
87
  super
88
- @user_class = Class.new(ActiveSambaLdap::SambaUser)
88
+ @user_class = Class.new(ActiveSambaLdap::User)
89
89
  @user_class.ldap_mapping
90
- @computer_class = Class.new(ActiveSambaLdap::SambaComputer)
90
+ @computer_class = Class.new(ActiveSambaLdap::Computer)
91
91
  @computer_class.ldap_mapping
92
- @group_class = Class.new(ActiveSambaLdap::SambaGroup)
92
+ @group_class = Class.new(ActiveSambaLdap::Group)
93
93
  @group_class.ldap_mapping
94
94
 
95
95
  @user_class.set_associated_class(:primary_group, @group_class)
data/test/run-test.rb CHANGED
@@ -11,6 +11,8 @@ $LOAD_PATH.unshift(File.join(top_dir, "test"))
11
11
 
12
12
  require 'test-unit-ext'
13
13
 
14
+ ARGV.unshift("--priority")
15
+
14
16
  if Test::Unit::AutoRunner.respond_to?(:standalone?)
15
17
  exit Test::Unit::AutoRunner.run($0, File.dirname($0))
16
18
  else
@@ -79,6 +79,10 @@ module Test
79
79
  def run_priority_low?(test_name)
80
80
  rand > 0.75
81
81
  end
82
+
83
+ def run_priority_never?(test_name)
84
+ false
85
+ end
82
86
  end
83
87
 
84
88
  def need_to_run?
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: activesambaldap
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.2
7
- date: 2007-01-29 00:00:00 +09:00
6
+ version: 0.0.3
7
+ date: 2007-05-26 00:00:00 +09:00
8
8
  summary: ActiveSambaLdap is a library and a management tool for Samba + LDAP environment.
9
9
  require_paths:
10
10
  - lib
@@ -53,27 +53,26 @@ files:
53
53
  - bin/asl-usermod
54
54
  - bin/asl-usershow
55
55
  - lib/active_samba_ldap.rb
56
- - lib/active_samba_ldap/account.rb
56
+ - lib/active_samba_ldap/account_entry.rb
57
57
  - lib/active_samba_ldap/base.rb
58
58
  - lib/active_samba_ldap/command.rb
59
59
  - lib/active_samba_ldap/computer.rb
60
- - lib/active_samba_ldap/computer_account.rb
60
+ - lib/active_samba_ldap/computer_account_entry.rb
61
61
  - lib/active_samba_ldap/configuration.rb
62
- - lib/active_samba_ldap/configuration_files
63
62
  - lib/active_samba_ldap/dc.rb
64
63
  - lib/active_samba_ldap/entry.rb
65
64
  - lib/active_samba_ldap/group.rb
65
+ - lib/active_samba_ldap/group_entry.rb
66
66
  - lib/active_samba_ldap/idmap.rb
67
67
  - lib/active_samba_ldap/ou.rb
68
68
  - lib/active_samba_ldap/populate.rb
69
69
  - lib/active_samba_ldap/reloadable.rb
70
- - lib/active_samba_ldap/samba_account.rb
71
- - lib/active_samba_ldap/samba_computer.rb
72
- - lib/active_samba_ldap/samba_group.rb
73
- - lib/active_samba_ldap/samba_user.rb
70
+ - lib/active_samba_ldap/samba_account_entry.rb
71
+ - lib/active_samba_ldap/samba_entry.rb
72
+ - lib/active_samba_ldap/samba_group_entry.rb
74
73
  - lib/active_samba_ldap/unix_id_pool.rb
75
74
  - lib/active_samba_ldap/user.rb
76
- - lib/active_samba_ldap/user_account.rb
75
+ - lib/active_samba_ldap/user_account_entry.rb
77
76
  - lib/active_samba_ldap/version.rb
78
77
  - lib/samba/encrypt.rb
79
78
  - misc/rd2html.rb
@@ -124,16 +123,17 @@ test_files:
124
123
  - test/test_asl_populate.rb
125
124
  - test/test_asl_groupmod.rb
126
125
  - test/test_asl_groupshow.rb
127
- - test/test_password.rb
126
+ - test/test_asl_purge.rb
128
127
  - test/test_asl_passwd.rb
129
128
  - test/test_asl_userdel.rb
130
129
  - test/test_asl_groupadd.rb
131
130
  - test/test_asl_usermod.rb
132
- - test/test_asl_purge.rb
133
131
  - test/test_group.rb
132
+ - test/test_password.rb
134
133
  - test/test_user_home_directory.rb
135
- rdoc_options: []
136
-
134
+ rdoc_options:
135
+ - --main
136
+ - README.txt
137
137
  extra_rdoc_files: []
138
138
 
139
139
  executables:
@@ -161,13 +161,13 @@ requirements: []
161
161
 
162
162
  dependencies:
163
163
  - !ruby/object:Gem::Dependency
164
- name: activeldap
164
+ name: ruby-activeldap
165
165
  version_requirement:
166
166
  version_requirements: !ruby/object:Gem::Version::Requirement
167
167
  requirements:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: 0.8.0
170
+ version: 0.8.2
171
171
  version:
172
172
  - !ruby/object:Gem::Dependency
173
173
  name: hoe
@@ -176,5 +176,5 @@ dependencies:
176
176
  requirements:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 1.1.7
179
+ version: 1.2.1
180
180
  version:
@@ -1,2 +0,0 @@
1
- /tmp/asl/etc/activesambaldap/config.yaml
2
- /tmp/asl/etc/activesambaldap/bind.yaml
@@ -1,20 +0,0 @@
1
- require 'active_samba_ldap/account'
2
- require 'active_samba_ldap/user_account'
3
- require 'active_samba_ldap/samba_account'
4
-
5
- module ActiveSambaLdap
6
- class SambaComputer < Base
7
- include Reloadable
8
-
9
- include Entry
10
-
11
- include Account
12
- include ComputerAccount
13
- include SambaAccount
14
-
15
- private
16
- def default_account_flags
17
- "[W]"
18
- end
19
- end
20
- end
@@ -1,39 +0,0 @@
1
- require 'active_samba_ldap/entry'
2
- require 'active_samba_ldap/account'
3
- require 'active_samba_ldap/user_account'
4
- require 'active_samba_ldap/samba_account'
5
-
6
- module ActiveSambaLdap
7
- class SambaUser < Base
8
- include Reloadable
9
-
10
- include Entry
11
-
12
- include Account
13
- include UserAccount
14
- include SambaAccount
15
-
16
- def fill_default_values(options={})
17
- super
18
-
19
- subst = Proc.new do |key|
20
- value = options[key]
21
- if value
22
- substitute_template(value)
23
- else
24
- substituted_value(key)
25
- end
26
- end
27
-
28
- self.samba_home_path ||= subst[:user_home_unc]
29
- self.samba_home_drive ||= subst[:user_home_drive].sub(/([^:])$/, "\\1:")
30
- self.samba_profile_path ||= subst[:user_profile]
31
- self.samba_logon_script ||= subst[:user_logon_script]
32
- end
33
-
34
- private
35
- def default_account_flags
36
- "[UH]"
37
- end
38
- end
39
- end