From null at cozmixng.org Fri Sep 7 22:30:42 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 11:30:42 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r103: Message-ID: <20070908023042.E37469BE4E@www.cozmixng.org> retro 2007-09-08 11:30:40 +0900 (Sat, 08 Sep 2007) New Revision: 103 Copied directories: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/ (from rev 100, trunk/rails/plugin/active_samba_ldap/generators/scaffold_asl/) Removed directories: trunk/rails/plugin/active_samba_ldap/generators/scaffold_asl/ Log: Copied: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/ (from rev 100, trunk/rails/plugin/active_samba_ldap/generators/scaffold_asl/) Deleted: trunk/rails/plugin/active_samba_ldap/generators/scaffold_asl/ % svn ls trunk/rails/plugin/active_samba_ldap/generators/scaffold_asl/@102 From null at cozmixng.org Fri Sep 7 22:30:47 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 11:30:47 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r104: Message-ID: <20070908023047.C0E049BE47@www.cozmixng.org> retro 2007-09-08 11:30:44 +0900 (Sat, 08 Sep 2007) New Revision: 104 Copied files: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb (from rev 103, trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb) Removed files: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb Log: Deleted: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb (+0 -28) =================================================================== --- trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb 2007-09-08 11:21:25 +09:00 (rev 103) +++ trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb 2007-09-08 11:30:44 +09:00 (rev 104) @@ -1,28 +0,0 @@ -class ScaffoldAslGenerator < Rails::Generator::Base - def manifest - record do |m| - - m.template("ldap.yml", File.join("config", "ldap.yml")) - - %w(user computer group unix_id_pool idmap ou dc).each do |component| - m.template("#{component}.rb", - File.join("app", "models", "#{component}.rb")) - end - - component = "samba" - controller_class_name = "#{Inflector.camelize(component)}Controller" - options = {:assigns => {:controller_class_name => controller_class_name}} - - m.template("#{component}_controller.rb", - File.join("app", "controllers", "#{component}_controller.rb")) - m.template("#{component}_helper.rb", - File.join("app", "helpers", "#{component}_helper.rb")) - m.directory(File.join("app", "views", component)) - %w(index populate purge).each do |action| - m.template("#{component}_#{action}.rhtml", - File.join("app", "views", component, "#{action}.rhtml"), - options) - end - end - end -end Copied: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb (+28 -0) =================================================================== --- trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_asl_generator.rb 2007-09-08 11:21:25 +09:00 (rev 103) +++ trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb 2007-09-08 11:30:44 +09:00 (rev 104) @@ -0,0 +1,28 @@ +class ScaffoldActiveSambaLdapGenerator < Rails::Generator::Base + def manifest + record do |m| + + m.template("ldap.yml", File.join("config", "ldap.yml")) + + %w(user computer group unix_id_pool idmap ou dc).each do |component| + m.template("#{component}.rb", + File.join("app", "models", "#{component}.rb")) + end + + component = "samba" + controller_class_name = "#{Inflector.camelize(component)}Controller" + options = {:assigns => {:controller_class_name => controller_class_name}} + + m.template("#{component}_controller.rb", + File.join("app", "controllers", "#{component}_controller.rb")) + m.template("#{component}_helper.rb", + File.join("app", "helpers", "#{component}_helper.rb")) + m.directory(File.join("app", "views", component)) + %w(index populate purge).each do |action| + m.template("#{component}_#{action}.rhtml", + File.join("app", "views", component, "#{action}.rhtml"), + options) + end + end + end +end From null at cozmixng.org Fri Sep 7 22:40:38 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 11:40:38 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r105: Message-ID: <20070908024038.A734A9BE43@www.cozmixng.org> retro 2007-09-08 11:40:35 +0900 (Sat, 08 Sep 2007) New Revision: 105 Modified files: trunk/README.en trunk/README.ja trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb Log: Modified: trunk/README.en (+5 -4) =================================================================== --- trunk/README.en 2007-09-08 11:23:10 +09:00 (rev 104) +++ trunk/README.en 2007-09-08 11:40:35 +09:00 (rev 105) @@ -50,11 +50,12 @@ Next, scaffold the environment of ActiveSambaLdap for Rails. - % script/generate scaffold_asl + % script/generate scaffold_active_samba_ldap -Modify config/ldap.yml generated by scaffold_asl to adapt -to your environment. See "Options in configuration file" -section to find available options. +Modify config/ldap.yml generated by +scaffold_active_samba_ldap to adapt to your environment. See +"Options in configuration file" section to find available +options. ==== Populate Modified: trunk/README.ja (+1 -1) =================================================================== --- trunk/README.ja 2007-09-08 11:23:10 +09:00 (rev 104) +++ trunk/README.ja 2007-09-08 11:40:35 +09:00 (rev 105) @@ -47,7 +47,7 @@ ???Rails?ActiveSambaLdap????????? - % script/generate scaffold_asl + % script/generate scaffold_active_samba_ldap config/ldap.yml?????????????????????? ?????????????????????????????? Modified: trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb (+0 -1) =================================================================== --- trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb 2007-09-08 11:23:10 +09:00 (rev 104) +++ trunk/rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb 2007-09-08 11:40:35 +09:00 (rev 105) @@ -1,7 +1,6 @@ class ScaffoldActiveSambaLdapGenerator < Rails::Generator::Base def manifest record do |m| - m.template("ldap.yml", File.join("config", "ldap.yml")) %w(user computer group unix_id_pool idmap ou dc).each do |component| From null at cozmixng.org Fri Sep 7 23:00:29 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 12:00:29 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r106: Message-ID: <20070908030029.8526C9BE3F@www.cozmixng.org> retro 2007-09-08 12:00:28 +0900 (Sat, 08 Sep 2007) New Revision: 106 Added files: trunk/lib/active_samba_ldap/get_text_support.rb Modified files: trunk/Rakefile trunk/lib/active_samba_ldap.rb trunk/lib/active_samba_ldap/base.rb trunk/lib/active_samba_ldap/command.rb trunk/lib/active_samba_ldap/configuration.rb trunk/lib/active_samba_ldap/entry.rb trunk/lib/active_samba_ldap/samba_group_entry.rb trunk/rails/plugin/active_samba_ldap/init.rb Log: Modified: trunk/lib/active_samba_ldap/samba_group_entry.rb (+1 -1) =================================================================== --- trunk/lib/active_samba_ldap/samba_group_entry.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/samba_group_entry.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -135,7 +135,7 @@ elsif TYPES.values.include?(type.to_i) # pass else - raise ArgumentError, "invalid type: #{type}" + raise ArgumentError, _("invalid type: %s") % type end self.samba_group_type = type.to_s end Modified: trunk/Rakefile (+30 -0) =================================================================== --- trunk/Rakefile 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/Rakefile 2007-09-08 12:00:28 +09:00 (rev 106) @@ -139,3 +139,33 @@ rm_f project.bin_files.collect {|f| f.sub(/^bin#{File::SEPARATOR}/, '')} end end + + +desc "Update *.po/*.pot files and create *.mo from *.po files" +task :gettext => ["gettext:po:update", "gettext:mo:create"] + +namespace :gettext do + desc "Setup environment for GetText" + task :environment do + require "gettext/utils" + end + + namespace :po do + desc "Update po/pot files (GetText)" + task :update => "gettext:environment" do + files = Dir.glob("{lib,rails}/**/*.rb") + GetText.update_pofiles("active-samba-ldap", + files, + "Ruby/ActiveSambaLdap #{ActiveSambaLdap::VERSION}") + end + end + + namespace :mo do + desc "Create *.mo from *.po (GetText)" + task :create => "gettext:environment" do + GetText.create_mofiles(false) + end + end +end + +task(:gem).prerequisites.unshift("gettext:mo:create") Modified: trunk/lib/active_samba_ldap.rb (+2 -1) =================================================================== --- trunk/lib/active_samba_ldap.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -8,7 +8,7 @@ end end -required_active_ldap_version = ">= 0.8.2" +required_active_ldap_version = ">= 0.8.3.1" require_gem_if_need.call("active_ldap", "ruby-activeldap", required_active_ldap_version) @@ -17,6 +17,7 @@ end require 'active_samba_ldap/version' +require 'active_samba_ldap/get_text_support' require 'active_samba_ldap/base' require "active_samba_ldap/configuration" require 'active_samba_ldap/populate' Modified: trunk/lib/active_samba_ldap/entry.rb (+1 -1) =================================================================== --- trunk/lib/active_samba_ldap/entry.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/entry.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -36,7 +36,7 @@ prefixes = [prefix] ou.split(/\s*,\s*/).reverse_each do |entry| name, value = entry.split(/\s*=\s*/, 2).collect {|x| x.strip} - raise ArgumentError, "#{ou} must be only ou" if name != "ou" + raise ArgumentError, _("%s must be only ou") % ou if name != "ou" ou_class = Class.new(ActiveSambaLdap::Ou) ou_class.ldap_mapping :prefix => prefixes.join(',') prefixes.unshift(entry) Modified: trunk/lib/active_samba_ldap/base.rb (+19 -17) =================================================================== --- trunk/lib/active_samba_ldap/base.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/base.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -2,13 +2,14 @@ module ActiveSambaLdap class Error < StandardError + include ActiveSambaLdap::GetTextSupport end class RequiredVariableIsNotSet < Error attr_reader :name def initialize(name) @name = name - super("required variable '#{name}' is not set") + super(_("required variable is not set: %s") % name) end end @@ -16,7 +17,7 @@ attr_reader :names def initialize(names) @names = names - super("required variables '#{names.join(', ')}' are not set") + super(_("required variables are not set: %s") % names.join(', ')) end end @@ -24,7 +25,7 @@ attr_reader :number def initialize(number) @number = number - super("uid number '#{@number}' already exists") + super(_("uid number already exists: %s") % number) end end @@ -32,7 +33,7 @@ attr_reader :name def initialize(name) @name = name - super("group '#{@name}' doesn't exist") + super(_("group doesn't exist: %s") % name) end end @@ -40,7 +41,7 @@ attr_reader :number def initialize(number) @number = number - super("gid number '#{@number}' already exists") + super(_("gid number already exists: %s") % number) end end @@ -48,7 +49,7 @@ attr_reader :number def initialize(number) @number = number - super("gid number '#{@number}' doesn't exist") + super(_("gid number doesn't exist: %s") % number) end end @@ -56,7 +57,7 @@ attr_reader :number def initialize(number) @number = number - super("sambaSID attribute doesn't exist for gid number '#{@number}'") + super(_("sambaSID attribute doesn't exist for gid number '%s'") % number) end end @@ -65,9 +66,9 @@ def initialize(group, members) @group = group @members = members - message = "cannot change primary group from '#{group}' to other group " - message << "due to no other belonged groups: #{members.join(', ')}" - super(message) + format = _("cannot change primary group from '%s' to other group " \ + "due to no other belonged groups: %s") + super(format % [group, members.join(', ')]) end end @@ -76,9 +77,9 @@ def initialize(group, members) @group = group @members = members - message = "cannot destroy group '#{group}' due to members who belong " - message << "to the group as primary group: #{members.join(', ')}" - super(message) + format = _("cannot destroy group '%s' due to members who belong " \ + "to the group as primary group: %s") + super(format % [group, members.join(', ')]) end end @@ -88,8 +89,8 @@ @file = file @location = location @detail = detail - super("found invalid configuration format at #{@file}:#{@location}" + - ": #{@detail}") + format = _("found invalid configuration format at %s:%s: %s") + super(format % [file, location, detail]) end end @@ -99,7 +100,8 @@ @name = name @value = value @detail = detail - super("the value of #{@name} '#{@value.inspect}' is invalid: #{@detail}") + format = _("the value of %s '%s' is invalid: %s") + super(format % [name, value.inspect, detail]) end end @@ -107,7 +109,7 @@ attr_reader :object def initialize(object) @object = object - super("#{@object.inspect} is not Samba available") + super(_("%s is not Samba available") % [object.inspect]) end end Added: trunk/lib/active_samba_ldap/get_text_support.rb (+12 -0) =================================================================== --- trunk/lib/active_samba_ldap/get_text_support.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/get_text_support.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -0,0 +1,12 @@ +module ActiveSambaLdap + module GetTextSupport + class << self + def included(base) + base.class_eval do + include(ActiveLdap::GetText) + bindtextdomain("active-samba-ldap") + end + end + end + end +end Modified: trunk/rails/plugin/active_samba_ldap/init.rb (+15 -3) =================================================================== --- trunk/rails/plugin/active_samba_ldap/init.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/rails/plugin/active_samba_ldap/init.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -1,6 +1,18 @@ require_library_or_gem 'active_samba_ldap' ActiveSambaLdap::Base.logger ||= RAILS_DEFAULT_LOGGER ldap_configuration_file = File.join(RAILS_ROOT, 'config', 'ldap.yml') -ActiveSambaLdap::Base.configurations = - ActiveSambaLdap::Configuration.read(ldap_configuration_file) -ActiveSambaLdap::Base.establish_connection +if File.exist?(ldap_configuration_file) + ActiveSambaLdap::Base.configurations = + ActiveSambaLdap::Configuration.read(ldap_configuration_file) + ActiveSambaLdap::Base.establish_connection +else + ActiveLdap::Base.class_eval do + format = _("You should run 'script/generator scaffold_active_samba_ldap' " \ + "to make %s.") + logger.error(format % ldap_configuration_file) + end +end + +class ActionView::Base + include ActiveLdap::Helper +end Modified: trunk/lib/active_samba_ldap/command.rb (+8 -6) =================================================================== --- trunk/lib/active_samba_ldap/command.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/command.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -5,6 +5,8 @@ module ActiveSambaLdap module Command + include ActiveSambaLdap::GetTextSupport + module_function def parse_options(argv=nil) argv ||= ARGV.dup @@ -13,22 +15,22 @@ opts = OptionParser.new do |opts| yield(opts, options) - opts.separator "" - opts.separator "Common options:" + opts.separator("") + opts.separator(_("Common options:")) opts.on_tail("--config=CONFIG", - "Specify configuration file", - "Default configuration files:", + _("Specify configuration file"), + _("Default configuration files:"), *configuration_files.collect {|x| " #{x}"}) do |file| configuration_files << file end - opts.on_tail("-h", "--help", "Show this message") do + opts.on_tail("-h", "--help", _("Show this message")) do puts opts exit end - opts.on_tail("--version", "Show version") do + opts.on_tail("--version", _("Show version")) do puts VERSION exit end Modified: trunk/lib/active_samba_ldap/configuration.rb (+3 -1) =================================================================== --- trunk/lib/active_samba_ldap/configuration.rb 2007-09-08 11:30:57 +09:00 (rev 105) +++ trunk/lib/active_samba_ldap/configuration.rb 2007-09-08 12:00:28 +09:00 (rev 106) @@ -78,6 +78,8 @@ end class Private + include ActiveSambaLdap::GetTextSupport + VARIABLES = %w(base host port scope bind_dn password method allow_anonymous @@ -305,7 +307,7 @@ types = AVAILABLE_HASH_TYPES.collect {|x| x.inspect}.join(", ") raise InvalidConfigurationValueError.new("password_hash_type", type, - "must be in #{types}") + _("must be in %s") % types) end end From null at cozmixng.org Fri Sep 7 23:20:34 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 12:20:34 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r107: Message-ID: <20070908032034.F320D9BE3F@www.cozmixng.org> retro 2007-09-08 12:20:32 +0900 (Sat, 08 Sep 2007) New Revision: 107 Added directories: trunk/po/ trunk/po/ja/ Added files: trunk/po/ja/active-samba-ldap.po Modified files: trunk/lib/active_samba_ldap/base.rb trunk/lib/active_samba_ldap/configuration.rb Log: Added: trunk/po/ Added: trunk/po/ja/ Added: trunk/po/ja/active-samba-ldap.po (+110 -0) =================================================================== --- trunk/po/ja/active-samba-ldap.po 2007-09-08 11:52:52 +09:00 (rev 106) +++ trunk/po/ja/active-samba-ldap.po 2007-09-08 12:20:32 +09:00 (rev 107) @@ -0,0 +1,110 @@ +# Japanese translations for Ruby/ActiveSambaLdap. +# Copyright (C) 2007 Kouhei Sutou +# This file is distributed under the same license as the Ruby/ActiveSambaLdap +# package. +# Kouhei Sutou , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: Ruby/ActiveSambaLdap 0.0.3\n" +"POT-Creation-Date: 2007-09-08 12:08+0900\n" +"PO-Revision-Date: 2007-09-08 12:09+0900\n" +"Last-Translator: Kouhei Sutou \n" +"Language-Team: Japanese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/active_samba_ldap/command.rb:19 +msgid "Common options:" +msgstr "????????:" + +#: lib/active_samba_ldap/command.rb:22 +msgid "Specify configuration file" +msgstr "?????????" + +#: lib/active_samba_ldap/command.rb:23 +msgid "Default configuration files:" +msgstr "????????????:" + +#: lib/active_samba_ldap/command.rb:28 +msgid "Show this message" +msgstr "??????????" + +#: lib/active_samba_ldap/command.rb:33 +msgid "Show version" +msgstr "????????" + +#: lib/active_samba_ldap/entry.rb:39 +msgid "%s must be only ou" +msgstr "%s?ou????????????" + +#: lib/active_samba_ldap/base.rb:15 +msgid "required variable is not set: %s" +msgid_plural "required variables are not set: %s" +msgstr[0] "???????????????: %s" +msgstr[1] "???????????????: %s" + +#: lib/active_samba_ldap/base.rb:27 +msgid "uid number already exists: %s" +msgstr "UID???????????: %s" + +#: lib/active_samba_ldap/base.rb:35 +msgid "group doesn't exist: %s" +msgstr "???????????: %s" + +#: lib/active_samba_ldap/base.rb:43 +msgid "gid number already exists: %s" +msgstr "GID???????????: %s" + +#: lib/active_samba_ldap/base.rb:51 +msgid "gid number doesn't exist: %s" +msgstr "GID?????????: %s" + +#: lib/active_samba_ldap/base.rb:59 +msgid "sambaSID attribute doesn't exist for gid number '%s'" +msgstr "GID??'%s'??sambaSID?????????" + +#: lib/active_samba_ldap/base.rb:68 +msgid "" +"cannot change primary group from '%s' to other group due to no other " +"belonged groups: %s" +msgstr "" +"????????????????????????????'%s'????????" +"?????????????: %s" + +#: lib/active_samba_ldap/base.rb:79 +msgid "" +"cannot destroy group '%s' due to members who belong to the group as primary " +"group: %s" +msgstr "" +"????????????????????????????????'%s'????" +"?????????: %s" + +#: lib/active_samba_ldap/base.rb:91 +msgid "found invalid configuration format at %s:%s: %s" +msgstr "%s:%s?????????????????: %s" + +#: lib/active_samba_ldap/base.rb:102 +msgid "the value of %s '%s' is invalid: %s" +msgstr "%s??'%s'?????: %s" + +#: lib/active_samba_ldap/base.rb:111 +msgid "%s is not Samba available" +msgstr "%s?Samba????????" + +#: lib/active_samba_ldap/configuration.rb:310 +msgid "must be in %s" +msgstr "%s????????????" + +#: lib/active_samba_ldap/samba_group_entry.rb:138 +msgid "invalid type: %s" +msgstr "?????: %s" + +#: rails/plugin/active_samba_ldap/init.rb:10 +msgid "" +"You should run 'script/generator scaffold_active_samba_ldap' to make %s." +msgstr "" +"%s??????'script/generator scaffold_active_samba_ldap'????????" +"??" Modified: trunk/lib/active_samba_ldap/base.rb (+9 -10) =================================================================== --- trunk/lib/active_samba_ldap/base.rb 2007-09-08 11:52:52 +09:00 (rev 106) +++ trunk/lib/active_samba_ldap/base.rb 2007-09-08 12:20:32 +09:00 (rev 107) @@ -5,20 +5,19 @@ include ActiveSambaLdap::GetTextSupport end - class RequiredVariableIsNotSet < Error - attr_reader :name - def initialize(name) - @name = name - super(_("required variable is not set: %s") % name) - end - end - - class RequiredVariablesAreNotSet < RequiredVariableIsNotSet + class MissingRequiredVariableError < Error attr_reader :names def initialize(names) + names = names.to_a @names = names - super(_("required variables are not set: %s") % names.join(', ')) + super(n_("required variable is not set: %s", + "required variables are not set: %s", + names.size) % names.join(', ')) end + + def name + @names.first + end end class UidNumberAlreadyExists < Error Modified: trunk/lib/active_samba_ldap/configuration.rb (+2 -2) =================================================================== --- trunk/lib/active_samba_ldap/configuration.rb 2007-09-08 11:52:52 +09:00 (rev 106) +++ trunk/lib/active_samba_ldap/configuration.rb 2007-09-08 12:20:32 +09:00 (rev 107) @@ -42,7 +42,7 @@ class ValidHash < Hash def [](name) if Private.required_variables.include?(name) and !has_key?(name) - raise RequiredVariableIsNotSet.new(name) + raise MissingRequiredVariableError.new(name) end super(name) end @@ -73,7 +73,7 @@ end end unless missing_variables.empty? - raise RequiredVariablesAreNotSet.new(missing_variables) + raise MissingRequiredVariableError.new(missing_variables) end end From null at cozmixng.org Sat Sep 8 06:51:03 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 19:51:03 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r108: Message-ID: <20070908105103.B544A9BE2D@www.cozmixng.org> retro 2007-09-08 19:51:02 +0900 (Sat, 08 Sep 2007) New Revision: 108 Modified directories: trunk/ trunk/html/ trunk/po/ Log: Modified: trunk/ Modified: trunk/html/ Modified: trunk/po/ Property changed: trunk (+0 -0) ___________________________________________________________________ Name: svn:ignore - .test-result .config pkg doc + .test-result .config pkg doc data Property changed: trunk/po (+0 -0) ___________________________________________________________________ Name: svn:ignore + *.pot Property changed: trunk/html (+0 -0) ___________________________________________________________________ Name: svn:ignore + *.ja *.en From null at cozmixng.org Sat Sep 8 07:50:42 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 08 Sep 2007 20:50:42 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r109: Message-ID: <20070908115042.9743F9BE34@www.cozmixng.org> retro 2007-09-08 20:50:40 +0900 (Sat, 08 Sep 2007) New Revision: 109 Modified files: trunk/Rakefile trunk/bin/asl-groupadd trunk/bin/asl-groupdel trunk/bin/asl-groupmod trunk/bin/asl-groupshow trunk/bin/asl-passwd trunk/bin/asl-populate trunk/bin/asl-purge trunk/bin/asl-samba-computeradd trunk/bin/asl-samba-groupadd trunk/bin/asl-samba-groupdel trunk/bin/asl-samba-groupmod trunk/bin/asl-samba-useradd trunk/bin/asl-samba-userdel trunk/bin/asl-samba-usermod trunk/bin/asl-useradd trunk/bin/asl-userdel trunk/bin/asl-usermod trunk/bin/asl-usershow Log: Modified: trunk/bin/asl-samba-usermod (+15 -8) =================================================================== --- trunk/bin/asl-samba-usermod 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-usermod 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.computer_account = false options.gid = nil @@ -10,11 +12,11 @@ opts.banner += " USER_NAME" opts.on("-c", "--[no-]computer-account", - "is a Windows Workstation", - "(otherwise, Windows user)", + _("is a Windows Workstation"), + _("(otherwise, Windows user)"), "(#{options.computer_account})") {|options.computer_account|} - opts.on("-g", "--gid=GID", "gid") {|options.gid|} + opts.on("-g", "--gid=GID", _("gid")) {|options.gid|} end name = nil @@ -41,21 +43,26 @@ options.computer_account = true if /\$$/ =~ name -member_class = options.computer_account ? Computer : User -member_type = member_class.name.downcase +if options.computer_account + member_class = Computer + member_type = _("computer") +else + member_class = User + member_type = _("user") +end if options.computer_account name = name.chomp("$") + "$" end unless member_class.exists?(name) - $stderr.puts "#{member_type} '#{name}' doesn't exist." + $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) exit 1 end member = member_class.find(name) unless Process.uid.zero? - password = ActiveSambaLdap::Command.read_password("Enter your password: ") + password = ActiveSambaLdap::Command.read_password(_("Enter your password: ")) auth_class = Class.new(ActiveSambaLdap::Base) config = ActiveSambaLdap::Base.configurations["reference"] @@ -64,7 +71,7 @@ :password => password, :allow_anonymous => false)) rescue ActiveLdap::AuthenticationError - $stderr.puts "password isn't match" + $stderr.puts(_("password isn't match.")) exit 1 ensure auth_class.remove_connection Modified: trunk/bin/asl-populate (+19 -14) =================================================================== --- trunk/bin/asl-populate 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-populate 2007-09-08 20:50:40 +09:00 (rev 109) @@ -7,6 +7,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| default = ActiveSambaLdap::Configuration::ClassMethods::Private.new({}) options.start_uid = Integer(default.start_uid) @@ -25,34 +27,37 @@ options.import_ldif = nil opts.on("-u", "--start-uid=UID", Integer, - "first uid number to allocate", + _("first uid number to allocate"), "(#{options.start_uid})") {|options.start_uid|} opts.on("-g", "--start-gid=GID", Integer, - "first gid number to allocate", + _("first gid number to allocate"), "(#{options.start_gid})") {|options.start_gid|} opts.on("-a", "--administrator=NAME", - "administrator login name", + _("administrator login name"), "(#{options.administrator})") {|options.administrator|} opts.on("--administrator-uid=UID", Integer, - "administrator's uid number", + _("administrator's uid number"), "(#{options.administrator_uid})") {|options.administrator_uid|} opts.on("--administrator-gid=GID", Integer, - "administrator's gid number", + _("administrator's gid number"), "(#{options.administrator_gid})") {|options.administrator_gid|} opts.on("-g", "--guest=NAME", - "guest login name (#{options.guest})") {|options.guest|} + _("guest login name"), + "(#{options.guest})") {|options.guest|} opts.on("--guest-uid=UID", Integer, - "guest's uid number (#{options.guest_uid})") {|options.guest_uid|} + _("guest's uid number"), + "(#{options.guest_uid})") {|options.guest_uid|} opts.on("--guest-gid=GID", Integer, - "guest's gid number (#{options.guest_gid})") {|options.guest_gid|} + _("guest's gid number"), + "(#{options.guest_gid})") {|options.guest_gid|} opts.on("-e", "--export-ldif=LDIF", - "export LDIF file") {|options.export_ldif|} + _("export LDIF file")) {|options.export_ldif|} # opts.on("-i", "--import-ldif=LDIF", -# "import LDIF file") {|options.import_ldif|} +# _("import LDIF file")) {|options.import_ldif|} end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -68,12 +73,12 @@ end return if admin.new_entry? - prompt = "Password for #{admin_name}: " + prompt = _("Password for %s: ") % admin_name password = ActiveSambaLdap::Command.read_password(prompt) - prompt2 = "Retype password for #{admin_name}: " + prompt2 = _("Retype password for %s: ") % admin_name password2 = ActiveSambaLdap::Command.read_password(prompt2) unless password == password2 - $stderr.puts "Passwords don't match." + $stderr.puts(_("Passwords don't match.")) exit 1 end Modified: trunk/Rakefile (+10 -0) =================================================================== --- trunk/Rakefile 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/Rakefile 2007-09-08 20:50:40 +09:00 (rev 109) @@ -153,7 +153,17 @@ namespace :po do desc "Update po/pot files (GetText)" task :update => "gettext:environment" do + module GetText::RGetText + class << self + alias_method :generate_pot_original, :generate_pot + def generate_pot(ary) + ary = ary.collect {|key, *other| [key.gsub(/\\/, "\\\\\\"), *other]} + generate_pot_original(ary) + end + end + end files = Dir.glob("{lib,rails}/**/*.rb") + files += Dir.glob("bin/asl*") GetText.update_pofiles("active-samba-ldap", files, "Ruby/ActiveSambaLdap #{ActiveSambaLdap::VERSION}") Modified: trunk/bin/asl-groupdel (+6 -3) =================================================================== --- trunk/bin/asl-groupdel 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-groupdel 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,13 +3,16 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.force = false opts.banner += " GROUP_NAME" opts.on("-f", "--[no-]force", - "force delete group (#{options.force})") {|options.force|} + _("force delete group"), + "(#{options.force})") {|options.force|} end name = nil @@ -21,7 +24,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -40,7 +43,7 @@ end unless Group.exists?(name) - $stderr.puts "group '#{name}' doesn't exist." + $stderr.puts(_("group '%s' doesn't exist.") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-groupadd (+7 -4) =================================================================== --- trunk/bin/asl-groupadd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-groupadd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.gid = nil options.group_type = "domain" @@ -12,9 +14,10 @@ opts.on("-g", "--gid=GID", Integer, "GID number") {|options.gid|} opts.on("-t", "--type=TYPE", - "group type (#{options.group_type})") {|options.group_type|} + _("group type"), + "(#{options.group_type})") {|options.group_type|} opts.on("-p", "--[no-]print-gid-number", - "print the gid number to stdout", + _("print the gid number to stdout"), "(#{options.print_gid_number})") {|options.print_gid_number|} end @@ -27,7 +30,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -42,7 +45,7 @@ end if Group.exists?(name) - $stderr.puts "group '#{name}' already exists." + $stderr.puts(_("group '%s' already exists.") % name) exit 1 end Modified: trunk/bin/asl-userdel (+17 -8) =================================================================== --- trunk/bin/asl-userdel 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-userdel 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.remove_home_directory = false options.interactive = false @@ -11,17 +13,19 @@ opts.banner += " USER_NAME" opts.on("-c", "--[no-]computer-account", - "is a Windows Workstation", - "(otherwise, Windows user)", + _("is a Windows Workstation"), + _("(otherwise, Windows user)"), "(#{options.computer_account})") {|options.computer_account|} opts.on("-r", "--[no-]remove-home-directory", - "remove home directory (#{options.remove_home_directory})") do |bool| + _("remove home directory"), + "(#{options.remove_home_directory})") do |bool| options.remove_home_directory = bool end opts.on("-i", "--[no-]interactive", - "do interactively (#{options.interactive})") do |bool| + _("do interactively"), + "(#{options.interactive})") do |bool| options.interactive = bool end end @@ -35,7 +39,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -53,15 +57,20 @@ ldap_mapping end -member_class = options.computer_account ? Computer : User -member_type = member_class.name.downcase +if options.computer_account + member_class = Computer + member_type = _("computer") +else + member_class = User + member_type = _("user") +end if options.computer_account name = name.chomp("$") + "$" end unless member_class.exists?(name) - $stderr.puts "#{member_type} '#{name}' doesn't exist." + $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) exit 1 end member = member_class.find(name) Modified: trunk/bin/asl-purge (+3 -1) =================================================================== --- trunk/bin/asl-purge 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-purge 2007-09-08 20:50:40 +09:00 (rev 109) @@ -7,11 +7,13 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end Modified: trunk/bin/asl-groupmod (+14 -10) =================================================================== --- trunk/bin/asl-groupmod 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-groupmod 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.gid = nil options.allow_non_unique_gid_number = false @@ -14,16 +16,16 @@ opts.on("-g", "--gid=GID", "gid") {|options.gid|} opts.on("--[no-]allow-non-unique-gid", - "gid can be non unique " + + _("gid can be non unique"), "(#{options.allow_non_unique_gid_number})") do |bool| options.allow_non_unique_gid_number = bool end opts.on("-r", "--rename=NEW_NAME", - "new group name") {|options.new_group_name|} + _("new group name")) {|options.new_group_name|} opts.on("-a", "--add-members=MEMBER1,MEMBER2,MEBMER3", Array, - "add members (comma delimited)") {|options.members_to_add|} + _("add members (comma delimited)")) {|options.members_to_add|} opts.on("-d", "--delete-members=MEMBER1,MEMBER2,MEBMER3", Array, - "delete members (comma delimited)") {|options.members_to_delete|} + _("delete members (comma delimited)")) {|options.members_to_delete|} end name = nil @@ -35,7 +37,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -54,7 +56,7 @@ end unless Group.exists?(name) - $stderr.puts "group '#{name}' doesn't exist." + $stderr.puts(_("group '%s' doesn't exist.") % name) exit 1 end group = Group.find(name) @@ -71,9 +73,11 @@ if options.members_to_add and options.members_to_delete duplicated_members = options.members_to_add & options.members_to_delete unless duplicated_members.empty? - message = "there are duplicated members in adding and deleting members: " - message << duplicated_members.join(", ") - $stderr.puts message + format = + n_("there is duplicated member in adding and deleting members: %s", + "there are duplicated members in adding and deleting members: %s", + duplicated_members.size) + $stderr.puts(format % duplicated_members.join(", ")) exit 1 end end @@ -110,7 +114,7 @@ if options.new_group_name if Group.exists?(options.new_group_name) - $stderr.puts "group '#{options.new_group_name}' always exists." + $stderr.puts(_("group '%s' always exists.") % options.new_group_name) exit 1 end Modified: trunk/bin/asl-useradd (+50 -49) =================================================================== --- trunk/bin/asl-useradd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-useradd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -5,6 +5,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.ou = nil options.computer_account = false @@ -28,7 +30,7 @@ options.samba_logon_script = nil options.samba_profile_path = nil options.samba_account_flags = nil - options.canonical_name = nil + options.common_name = nil options.given_name = nil options.surname = nil options.mail_addresses = nil @@ -37,8 +39,8 @@ opts.banner += " USER_NAME" opts.on("-o", "--ou=OU", - "add the user in the organizational unit OU", - "(relative to the user suffix)") do |ou| + _("add the user in the organizational unit OU"), + _("(relative to the user suffix)")) do |ou| if /^ou=/ =~ ou options.ou = ou else @@ -46,88 +48,86 @@ end end opts.on("-c", "--[no-]computer-account", - "is a Windows Workstation", - "(otherwise, Windows user)", + _("is a Windows Workstation"), + _("(otherwise, Windows user)"), "(#{options.computer_account})") {|options.computer_account|} - opts.on("-u", "--uid=UID", Integer, "uid") {|options.uid|} - opts.on("-g", "--gid=GID", "gid") {|options.gid|} + opts.on("-u", "--uid=UID", Integer, _("uid")) {|options.uid|} + opts.on("-g", "--gid=GID", _("gid")) {|options.gid|} opts.on("-G", "--groups=GID1,GID2,GID3", Array, - "supplementary groups (comma separated)") do |groups| + _("supplementary groups (comma separated)")) do |groups| options.supplementary_groups = groups end opts.on("--[no-]create-group", - "create a group for the user", + _("create a group for the user"), "(#{options.create_group})") {|options.create_group|} opts.on("-c", "--comment=COMMENT", - "set the GECOS field for the new user account") {|options.comment|} - opts.on("-s", "--shell=SHELL", "shell") {|options.shell|} - opts.on("-G", "--given-name=NAME", "given name") {|options.given_name|} - opts.on("-N", "--canonical-name=NAME", - "canonical name") {|options.canonical_name|} - opts.on("-S", "--surname=NAME", "surname") {|options.surname|} + _("set the GECOS field for the new user account")) {|options.comment|} + opts.on("-s", "--shell=SHELL", _("shell")) {|options.shell|} + opts.on("-G", "--given-name=NAME", _("given name")) {|options.given_name|} + opts.on("-N", "--common-name=NAME", + _("common name")) {|options.common_name|} + opts.on("-S", "--surname=NAME", _("surname")) {|options.surname|} opts.on("-d", "--home-directory=HOME_DIR", - "home directory") {|options.home_directory|} + _("home directory")) {|options.home_directory|} opts.on("--home-directory-mode=MODE", - "permission of home directory") {|options.home_directory_mode|} + _("permission of home directory")) {|options.home_directory_mode|} opts.on("--[no-]setup-home-directory", - "setup home directory", + _("setup home directory"), "(#{options.setup_home_directory})") {|options.setup_home_directory|} opts.on("-k", "--skel=DIR", "--skeleton-directory=DIR", - "skeleton directory") {|options.skeleton_directory|} + _("skeleton directory")) {|options.skeleton_directory|} opts.on("--time=TIME", Integer, - "wait TIME seconds before exiting", + _("wait TIME seconds before exiting"), "(#{options.time})") {|options.time|} opts.separator("") - opts.separator("For samba accounts:") + opts.separator(_("For samba accounts:")) - opts.on("-e", "--expire-date=DATE", "expire date") do |date| + opts.on("-e", "--expire-date=DATE", _("expire date")) do |date| options.expire_date = Time.parse(date) end opts.on("-C", "--[no-]can-change-password", - "can change password") do |bool| + _("can change password")) do |bool| options.can_change_password = bool end opts.on("-M", "--[no-]must-change-password", - "must change password") do |bool| + _("must change password")) do |bool| options.must_change_password = bool end opts.on("--samba-home-path=UNC", - "sambaHomePath", - "(SMB home share, like '\\\\PDC\\user'") do |unc| + _("sambaHomePath"), + _("(SMB home share, like '\\\\PDC\\user'")) do |unc| options.samba_home_unc = unc end opts.on("--samba-home-drive=DRIVE", - "sambaHomeDrive", - "(letter associated with home share,", - " like 'H:')") do |drive| + _("sambaHomeDrive"), + _("(letter associated with home share, like 'H:')")) do |drive| options.samba_home_drive = drive end opts.on("--samba-logon-script=SCRIPT", - "sambaLogonScript", - "(DOS script to execute on login)") do |script| + _("sambaLogonScript"), + _("(DOS script to execute on login)")) do |script| options.samba_logon_script = script end opts.on("--samba-profile-path=PATH", - "sambaProfilePath", - "(profile directory,", - " like '\\\\PDC\\profiles\\user')") do |path| + _("sambaProfilePath"), + _("(profile directory, like '\\\\PDC\\profiles\\user')")) do |path| options.samba_profile_path = path end opts.on("--samba-account-flags=FLAGS", - "sambaAcctFlags", - "(samba account control bits,", - " like '[NDHTUMWSLXI]')") {|options.samba_account_flags|} + _("sambaAcctFlags"), + _("(samba account control bits, " \ + "like '[NDHTUMWSLXI]')")) {|options.samba_account_flags|} # opts.on("--mail-addresses=ADDRESS1,ADDRESS2,ADDRESS3", # Array, -# "mailAddresses (comma separated)") {|options.mail_addresses|} +# _("mailAddresses (comma separated)")) {|options.mail_addresses|} # opts.on("--mail-to-addresses=ADDRESS1,ADDRESS2,ADDRESS3", # Array, -# "mailToAddresses (forward address)", -# "(comma separated)") do |addresses| +# _("mailToAddresses (forward address)"), +# _("(comma separated)")) do |addresses| # options.mail_to_addresses = addresses # end end @@ -141,7 +141,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -164,21 +164,22 @@ ldap_mapping end -member_class = options.computer_account ? Computer : User - -member_type = member_class.name.downcase - if options.computer_account + member_class = Computer + member_type = _("computer") name = name.chomp("$") + "$" +else + member_class = User + member_type = _("user") end unless member_class.valid_name?(name) - $stderr.puts "'#{name}' is illegal #{member_type} name" + $stderr.puts(_("'%s' is illegal %s name.") % [name, member_type]) exit 1 end if member_class.exists?(name) - $stderr.puts "#{member_type} '#{name}' already exists." + $stderr.puts(_("%s '%s' already exists.") % [member_type, name]) exit 1 end @@ -191,7 +192,7 @@ :home_directory => options.home_directory, :login_shell => options.shell, :given_name => options.given_name, - :cn => options.canonical_name, + :cn => options.common_name, :sn => options.surname, :gecos => options.comment, :samba_acct_flags => options.samba_account_flags, @@ -220,7 +221,7 @@ begin member = member_class.create(create_options) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts "UID '#{uid_number}' already exists" + $stderr.puts(_("UID '%s' already exists.") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, Modified: trunk/bin/asl-usermod (+54 -49) =================================================================== --- trunk/bin/asl-usermod 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-usermod 2007-09-08 20:50:40 +09:00 (rev 109) @@ -6,6 +6,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.computer_account = false options.gecos = nil @@ -20,7 +22,7 @@ options.supplementary_groups = nil options.shell = nil options.given_name = nil - options.canonical_name = nil + options.common_name = nil options.surname = nil options.expire_date = nil @@ -39,94 +41,94 @@ opts.banner += " USER_NAME" opts.on("-c", "--[no-]computer-account", - "is a Windows Workstation", - "(otherwise, Windows user)", + _("is a Windows Workstation"), + _("(otherwise, Windows user)"), "(#{options.computer_account})") {|options.computer_account|} - opts.on("--gecos=GECOS", "gecos") {|options.gecos|} + opts.on("--gecos=GECOS", _("gecos")) {|options.gecos|} opts.on("-d", "--home-directory=HOME_DIR", - "home directory") {|options.home_directory|} + _("home directory")) {|options.home_directory|} opts.on("-m", "--[no-]move-home-directory", - "move home directory (#{options.move_home_directory})") do |bool| + _("move home directory"), + "(#{options.move_home_directory})") do |bool| options.move_home_directory = bool end opts.on("-r", "--rename=NEW_NAME", - "new user name (cn and dn are updated)") do |name| + _("new user name (cn and dn are updated)")) do |name| options.new_user_name = name end - opts.on("-u", "--uid=UID", Integer, "uid") {|options.uid|} + opts.on("-u", "--uid=UID", Integer, _("uid")) {|options.uid|} opts.on("--[no-]allow-non-unique-uid", - "uid can be non unique " + + _("uid can be non unique "), "(#{options.allow_non_unique_uid_number})") do |bool| options.allow_non_unique_uid_number = bool end opts.on("-g", "--gid=GID", "gid") {|options.gid|} opts.on("-G", "--groups=GID1,GID2,GID3", Array, - "supplementary groups (comma separated)") do |groups| + _("supplementary groups (comma separated)")) do |groups| options.supplementary_groups = groups end opts.on("--[no-]merge-groups", - "replace supplementary groups " + + _("replace supplementary groups "), "(#{!options.merge_groups})") {|options.merge_groups|} - opts.on("-s", "--shell=SHELL", "shell") {|options.shell|} - opts.on("--given-name=NAME", "given name") {|options.given_name|} - opts.on("-N", "--canonical-name=NAME", - "canonical name") {|options.canonical_name|} - opts.on("-S", "--surname=NAME", "surname") {|options.surname|} + opts.on("-s", "--shell=SHELL", _("shell")) {|options.shell|} + opts.on("--given-name=NAME", _("given name")) {|options.given_name|} + opts.on("-N", "--common-name=NAME", + _("common name")) {|options.common_name|} + opts.on("-S", "--surname=NAME", _("surname")) {|options.surname|} opts.separator("") - opts.separator("For samba users:") + opts.separator(_("For samba accounts:")) - opts.on("-e", "--expire-date=DATE", "expire date") do |date| + opts.on("-e", "--expire-date=DATE", _("expire date")) do |date| options.expire_date = Time.parse(date) end opts.on("-C", "--[no-]can-change-password", - "can change password") do |bool| + _("can change password")) do |bool| options.can_change_password = bool end opts.on("-M", "--[no-]must-change-password", - "must change password") do |bool| + _("must change password")) do |bool| options.must_change_password = bool end opts.on("--samba-home-path=PATH", - "sambaHomePath", - "(SMB home share, like '\\\\PDC\\user'") do |path| + _("sambaHomePath"), + _("(SMB home share, like '\\\\PDC\\user'")) do |path| options.samba_home_path = path end opts.on("--samba-home-drive=DRIVE", - "sambaHomeDrive", - "(letter associated with home share,", - " like 'H:')") do |drive| + _("sambaHomeDrive"), + _("(letter associated with home share, like 'H:')")) do |drive| options.samba_home_drive = drive end opts.on("--samba-logon-script=SCRIPT", - "sambaLogonScript", - "(DOS script to execute on login)") do |script| + _("sambaLogonScript"), + _("(DOS script to execute on login)")) do |script| options.samba_logon_script = script end opts.on("--samba-profile-path=PATH", - "sambaProfilePath", - "(profile directory,", - " like '\\\\PDC\\profiles\\user')") do |path| + _("sambaProfilePath"), + _("(profile directory, " \ + "like '\\\\PDC\\profiles\\user')")) do |path| options.samba_profile_path = path end opts.on("--samba-account-flags=FLAGS", - "sambaAcctFlags", - "(samba account control bits,", - " like '[NDHTUMWSLXI]')") {|options.samba_account_flags|} - opts.on("-D", "--[no-]disable-user", "disable an user") do |bool| + _("sambaAcctFlags"), + _("(samba account control bits, " \ + "like '[NDHTUMWSLXI]')")) {|options.samba_account_flags|} + opts.on("-D", "--[no-]disable-user", _("disable this user")) do |bool| options.enable = !bool end - opts.on("-E", "--[no-]enable-user", "enable an user") do |bool| + opts.on("-E", "--[no-]enable-user", _("enable this user")) do |bool| options.enable = bool end # opts.on("--mail-addresses=ADDRESS1,ADDRESS2,ADDRESS3", # Array, -# "mailAddresses (comma separated)") {|options.mail_addresses|} +# _("mailAddresses (comma separated)")) {|options.mail_addresses|} # opts.on("--mail-to-addresses=ADDRESS1,ADDRESS2,ADDRESS3", # Array, -# "mailToAddresses (forward address)", -# "(comma separated)") do |addresses| +# _("mailToAddresses (forward address)"), +# _("(comma separated)")) do |addresses| # options.mail_to_addresses = addresses # end end @@ -155,21 +157,23 @@ options.computer_account = true if /\$$/ =~ name -member_class = options.computer_account ? Computer : User -member_type = member_class.name.downcase - if options.computer_account + member_class = Computer + member_type = _("computer") name = name.chomp("$") + "$" +else + member_class = User + member_type = _("user") end unless member_class.exists?(name) - $stderr.puts "#{member_type} '#{name}' doesn't exist." + $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) exit 1 end member = member_class.find(name) unless Process.uid.zero? - password = ActiveSambaLdap::Command.read_password("Enter your password: ") + password = ActiveSambaLdap::Command.read_password(_("Enter your password: ")) auth_class = Class.new(ActiveSambaLdap::Base) config = ActiveSambaLdap::Base.configurations["reference"] @@ -178,7 +182,7 @@ :password => password, :allow_anonymous => false)) rescue ActiveLdap::AuthenticationError - $stderr.puts "password isn't match" + $stderr.puts(_("password isn't match.")) exit 1 ensure auth_class.remove_connection @@ -220,8 +224,8 @@ member.home_directory = options.home_directory end -if options.canonical_name - member.cn = options.canonical_name +if options.common_name + member.cn = options.common_name end if options.surname @@ -233,11 +237,11 @@ end if options.mail_addresses - raise "not implemented" + raise _("not implemented") end if options.mail_to_addresses - raise "not implemented" + raise _("not implemented") end if options.supplementary_groups @@ -307,7 +311,8 @@ options.new_user_name = options.new_user_name.chomp("$") + "$" end if member_class.exists?(options.new_user_name) - $stderr.puts "#{member_type} '#{options.new_user_name}' always exists." + format = _("%s '%s' always exists.") + $stderr.puts(format % [member_type, options.new_user_name]) exit 1 end new_member = member_class.new(options.new_user_name) Modified: trunk/bin/asl-samba-computeradd (+8 -6) =================================================================== --- trunk/bin/asl-samba-computeradd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-computeradd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,14 +3,16 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.ou = nil opts.banner += " COMPUTER_NAME" opts.on("-o", "--ou=OU", - "add the user in the organizational unit OU", - "(relative to the user suffix)") do |ou| + _("add the user in the organizational unit OU"), + _("(relative to the user suffix)")) do |ou| if /^ou=/ =~ ou options.ou = ou else @@ -28,7 +30,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -52,12 +54,12 @@ end unless Computer.valid_name?(name) - $stderr.puts "'#{name}' is illegal computer name" + $stderr.puts(_("'%s' is illegal computer name.") % name) exit 1 end if Computer.exists?(name) - $stderr.puts "computer '#{name}' already exists." + $stderr.puts(_("computer '%s' already exists.") % name) exit 1 end @@ -73,7 +75,7 @@ begin computer = Computer.create(:uid => name, :group_class => Group) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts "UID '#{uid_number}' already exists" + $stderr.puts(_("UID '%s' already exists.") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, Modified: trunk/bin/asl-samba-groupdel (+4 -2) =================================================================== --- trunk/bin/asl-samba-groupdel 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-groupdel 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| opts.banner += " GROUP_NAME" end @@ -16,7 +18,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -35,7 +37,7 @@ end unless Group.exists?(name) - $stderr.puts "group '#{name}' doesn't exist." + $stderr.puts(_("group '%s' doesn't exist.") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-groupshow (+3 -1) =================================================================== --- trunk/bin/asl-groupshow 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-groupshow 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| opts.banner += " GROUP_NAME" end @@ -22,7 +24,7 @@ end unless Group.exists?(name) - $stderr.puts "group '#{name}' doesn't exist." + $stderr.puts(_("group '%s' doesn't exist.") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-samba-groupadd (+4 -2) =================================================================== --- trunk/bin/asl-samba-groupadd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-groupadd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| opts.banner += " GROUP_NAME" end @@ -16,7 +18,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -31,7 +33,7 @@ end if Group.exists?(name) - $stderr.puts "group '#{name}' already exists." + $stderr.puts(_("group '%s' already exists.") % name) exit 1 end Modified: trunk/bin/asl-usershow (+3 -1) =================================================================== --- trunk/bin/asl-usershow 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-usershow 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| opts.banner += " USER_NAME" end @@ -22,7 +24,7 @@ end unless User.exists?(name) - $stderr.puts "user '#{name}' doesn't exist." + $stderr.puts(_("user '%s' doesn't exist.") % name) exit 1 end user = User.find(name) Modified: trunk/bin/asl-samba-groupmod (+8 -7) =================================================================== --- trunk/bin/asl-samba-groupmod 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-groupmod 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.members_to_add = nil options.members_to_delete = nil @@ -10,9 +12,9 @@ opts.banner += " GROUP_NAME" opts.on("-a", "--add-members=MEMBER1,MEMBER2,MEBMER3", Array, - "add members (comma delimited)") {|options.members_to_add|} + _("add members (comma delimited)")) {|options.members_to_add|} opts.on("-d", "--delete-members=MEMBER1,MEMBER2,MEBMER3", Array, - "delete members (comma delimited)") {|options.members_to_delete|} + _("delete members (comma delimited)")) {|options.members_to_delete|} end name = nil @@ -24,7 +26,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -43,7 +45,7 @@ end unless Group.exists?(name) - $stderr.puts "group '#{name}' doesn't exist." + $stderr.puts(_("group '%s' doesn't exist.") % name) exit 1 end group = Group.find(name) @@ -51,9 +53,8 @@ if options.members_to_add and options.members_to_delete duplicated_members = options.members_to_add & options.members_to_delete unless duplicated_members.empty? - message = "there are duplicated members in adding and deleting members: " - message << duplicated_members.join(", ") - $stderr.puts message + format = _("there are duplicated members in adding and deleting members: %s") + $stderr.puts(format % duplicated_members.join(", ")) exit 1 end end Modified: trunk/bin/asl-samba-userdel (+4 -2) =================================================================== --- trunk/bin/asl-samba-userdel 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-userdel 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,6 +3,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| opts.banner += " USER_NAME" end @@ -16,7 +18,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -35,7 +37,7 @@ end unless User.exists?(name) - $stderr.puts "user '#{name}' doesn't exist." + $stderr.puts(_("user '%s' doesn't exist.") % name) exit 1 end Modified: trunk/bin/asl-passwd (+13 -9) =================================================================== --- trunk/bin/asl-passwd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-passwd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -5,6 +5,8 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.update_samba_password = true options.update_unix_password = true @@ -12,12 +14,14 @@ opts.banner += " [USER_NAME]" opts.on("-s", "--[no-]samba-password", - "update samba password (#{options.update_samba_password})") do |bool| + _("update samba password"), + "(#{options.update_samba_password})") do |bool| options.update_samba_password = bool end opts.on("-u", "--[no-]unix-password", - "update UNIX password (#{options.update_unix_password})") do |bool| + _("update UNIX password"), + "(#{options.update_unix_password})") do |bool| options.update_unix_password = bool end end @@ -34,7 +38,7 @@ end if !options.update_samba_password and !options.update_unix_password - $stderr.puts "do nothing" + $stderr.puts(_("do nothing.")) exit end @@ -45,13 +49,13 @@ end unless User.exists?(name) - $stderr.puts "user '#{name}' doesn't exist." + $stderr.puts(_("user '%s' doesn't exist.") % name) exit 1 end user = User.find(name) unless Process.uid.zero? - prompt = "Enter your current password: " + prompt = _("Enter your current password: ") old_password = ActiveSambaLdap::Command.read_password(prompt) auth_class = Class.new(ActiveSambaLdap::Base) @@ -61,18 +65,18 @@ :password => old_password, :allow_anonymous => false)) rescue ActiveLdap::AuthenticationError - $stderr.puts "password isn't match" + $stderr.puts(_("password isn't match.")) exit 1 ensure auth_class.remove_connection end end -password = ActiveSambaLdap::Command.read_password("New password: ") -password2 = ActiveSambaLdap::Command.read_password("Retype new password: ") +password = ActiveSambaLdap::Command.read_password(_("New password: ")) +password2 = ActiveSambaLdap::Command.read_password(_("Retype new password: ")) unless password == password2 - $stderr.puts "New passwords don't match." + $stderr.puts(_("New passwords don't match.")) exit 1 end Modified: trunk/bin/asl-samba-useradd (+8 -6) =================================================================== --- trunk/bin/asl-samba-useradd 2007-09-08 19:48:19 +09:00 (rev 108) +++ trunk/bin/asl-samba-useradd 2007-09-08 20:50:40 +09:00 (rev 109) @@ -3,14 +3,16 @@ require 'active_samba_ldap' require 'active_samba_ldap/command' +include ActiveSambaLdap::GetTextSupport + argv, opts, options = ActiveSambaLdap::Command.parse_options do |opts, options| options.ou = nil opts.banner += " USER_NAME" opts.on("-o", "--ou=OU", - "add the user in the organizational unit OU", - "(relative to the user suffix)") do |ou| + _("add the user in the organizational unit OU"), + _("(relative to the user suffix)")) do |ou| if /^ou=/ =~ ou options.ou = ou else @@ -28,7 +30,7 @@ end unless Process.uid.zero? - $stderr.puts "need root authority." + $stderr.puts(_("need root authority.")) exit 1 end @@ -52,12 +54,12 @@ end unless User.valid_name?(name) - $stderr.puts "'#{name}' is illegal user name" + $stderr.puts(_("'%s' is illegal user name.") % name) exit 1 end if User.exists?(name) - $stderr.puts "user '#{name}' already exists." + $stderr.puts(_("user '%s' already exists.") % name) exit 1 end @@ -70,7 +72,7 @@ begin user = User.create(:uid => name, :group_class => Group) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts "UID '#{uid_number}' already exists" + $stderr.puts(_("UID '%s' already exists") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, From null at cozmixng.org Fri Sep 14 09:20:27 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 14 Sep 2007 22:20:27 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r110: Message-ID: <20070914132027.428219BE2D@www.cozmixng.org> retro 2007-09-14 22:20:25 +0900 (Fri, 14 Sep 2007) New Revision: 110 Modified files: trunk/bin/asl-samba-useradd Log: Modified: trunk/bin/asl-samba-useradd (+1 -1) =================================================================== --- trunk/bin/asl-samba-useradd 2007-09-08 20:42:29 +09:00 (rev 109) +++ trunk/bin/asl-samba-useradd 2007-09-14 22:20:25 +09:00 (rev 110) @@ -72,7 +72,7 @@ begin user = User.create(:uid => name, :group_class => Group) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts(_("UID '%s' already exists") % uid_number) + $stderr.puts(_("UID '%s' already exists.") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, From null at cozmixng.org Fri Sep 14 09:20:30 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 14 Sep 2007 22:20:30 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r111: Message-ID: <20070914132030.574929BE3F@www.cozmixng.org> retro 2007-09-14 22:20:28 +0900 (Fri, 14 Sep 2007) New Revision: 111 Modified files: trunk/test/asl-test-utils.rb Log: Modified: trunk/test/asl-test-utils.rb (+1 -0) =================================================================== --- trunk/test/asl-test-utils.rb 2007-09-14 22:15:47 +09:00 (rev 110) +++ trunk/test/asl-test-utils.rb 2007-09-14 22:20:28 +09:00 (rev 111) @@ -12,6 +12,7 @@ module AslTestUtils def self.included(base) base.class_eval do + include ActiveSambaLdap::GetTextSupport include Configuration include Connection include Populate From null at cozmixng.org Fri Sep 14 09:20:33 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 14 Sep 2007 22:20:33 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r112: Message-ID: <20070914132033.261229BE47@www.cozmixng.org> retro 2007-09-14 22:20:31 +0900 (Fri, 14 Sep 2007) New Revision: 112 Modified files: trunk/test/run-test.rb Log: Modified: trunk/test/run-test.rb (+2 -0) =================================================================== --- trunk/test/run-test.rb 2007-09-14 22:16:11 +09:00 (rev 111) +++ trunk/test/run-test.rb 2007-09-14 22:20:31 +09:00 (rev 112) @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +$KCODE = 'u' + require "test/unit" top_dir = File.join(File.dirname(__FILE__), "..") From null at cozmixng.org Fri Sep 14 22:30:26 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 15 Sep 2007 11:30:26 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r113: Message-ID: <20070915023026.2251D9BE5C@www.cozmixng.org> retro 2007-09-15 11:30:23 +0900 (Sat, 15 Sep 2007) New Revision: 113 Modified files: trunk/bin/asl-groupadd trunk/bin/asl-groupdel trunk/bin/asl-groupmod trunk/bin/asl-groupshow trunk/bin/asl-passwd trunk/bin/asl-samba-computeradd trunk/bin/asl-samba-groupadd trunk/bin/asl-samba-groupdel trunk/bin/asl-samba-groupmod trunk/bin/asl-samba-useradd trunk/bin/asl-samba-userdel trunk/bin/asl-samba-usermod trunk/bin/asl-useradd trunk/bin/asl-userdel trunk/bin/asl-usermod trunk/bin/asl-usershow Log: Modified: trunk/bin/asl-samba-usermod (+1 -1) =================================================================== --- trunk/bin/asl-samba-usermod 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-usermod 2007-09-15 11:30:23 +09:00 (rev 113) @@ -56,7 +56,7 @@ end unless member_class.exists?(name) - $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) + $stderr.puts(_("%s doesn't exist: %s") % [member_type, name]) exit 1 end member = member_class.find(name) Modified: trunk/bin/asl-groupdel (+1 -1) =================================================================== --- trunk/bin/asl-groupdel 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-groupdel 2007-09-15 11:30:23 +09:00 (rev 113) @@ -43,7 +43,7 @@ end unless Group.exists?(name) - $stderr.puts(_("group '%s' doesn't exist.") % name) + $stderr.puts(_("group doesn't exist: %s") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-groupadd (+1 -1) =================================================================== --- trunk/bin/asl-groupadd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-groupadd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -45,7 +45,7 @@ end if Group.exists?(name) - $stderr.puts(_("group '%s' already exists.") % name) + $stderr.puts(_("group already exists: %s") % name) exit 1 end Modified: trunk/bin/asl-userdel (+1 -1) =================================================================== --- trunk/bin/asl-userdel 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-userdel 2007-09-15 11:30:23 +09:00 (rev 113) @@ -70,7 +70,7 @@ end unless member_class.exists?(name) - $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) + $stderr.puts(_("%s doesn't exist: %s") % [member_type, name]) exit 1 end member = member_class.find(name) Modified: trunk/bin/asl-groupmod (+2 -2) =================================================================== --- trunk/bin/asl-groupmod 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-groupmod 2007-09-15 11:30:23 +09:00 (rev 113) @@ -56,7 +56,7 @@ end unless Group.exists?(name) - $stderr.puts(_("group '%s' doesn't exist.") % name) + $stderr.puts(_("group doesn't exist: %s") % name) exit 1 end group = Group.find(name) @@ -114,7 +114,7 @@ if options.new_group_name if Group.exists?(options.new_group_name) - $stderr.puts(_("group '%s' always exists.") % options.new_group_name) + $stderr.puts(_("group already exists: %s") % options.new_group_name) exit 1 end Modified: trunk/bin/asl-useradd (+3 -3) =================================================================== --- trunk/bin/asl-useradd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-useradd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -174,12 +174,12 @@ end unless member_class.valid_name?(name) - $stderr.puts(_("'%s' is illegal %s name.") % [name, member_type]) + $stderr.puts(_("illegal %s name: %s") % [name, member_type]) exit 1 end if member_class.exists?(name) - $stderr.puts(_("%s '%s' already exists.") % [member_type, name]) + $stderr.puts(_("%s already exists: %s") % [member_type, name]) exit 1 end @@ -221,7 +221,7 @@ begin member = member_class.create(create_options) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts(_("UID '%s' already exists.") % uid_number) + $stderr.puts(_("UID already exists: %s") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, Modified: trunk/bin/asl-usermod (+2 -2) =================================================================== --- trunk/bin/asl-usermod 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-usermod 2007-09-15 11:30:23 +09:00 (rev 113) @@ -167,7 +167,7 @@ end unless member_class.exists?(name) - $stderr.puts(_("%s '%s' doesn't exist.") % [member_type, name]) + $stderr.puts(_("%s doesn't exist: %s") % [member_type, name]) exit 1 end member = member_class.find(name) @@ -311,7 +311,7 @@ options.new_user_name = options.new_user_name.chomp("$") + "$" end if member_class.exists?(options.new_user_name) - format = _("%s '%s' always exists.") + format = _("%s already exists: %s") $stderr.puts(format % [member_type, options.new_user_name]) exit 1 end Modified: trunk/bin/asl-samba-computeradd (+3 -3) =================================================================== --- trunk/bin/asl-samba-computeradd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-computeradd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -54,12 +54,12 @@ end unless Computer.valid_name?(name) - $stderr.puts(_("'%s' is illegal computer name.") % name) + $stderr.puts(_("illegal computer name: %s") % name) exit 1 end if Computer.exists?(name) - $stderr.puts(_("computer '%s' already exists.") % name) + $stderr.puts(_("computer already exists: %s") % name) exit 1 end @@ -75,7 +75,7 @@ begin computer = Computer.create(:uid => name, :group_class => Group) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts(_("UID '%s' already exists.") % uid_number) + $stderr.puts(_("UID already exists: %s") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, Modified: trunk/bin/asl-samba-groupdel (+1 -1) =================================================================== --- trunk/bin/asl-samba-groupdel 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-groupdel 2007-09-15 11:30:23 +09:00 (rev 113) @@ -37,7 +37,7 @@ end unless Group.exists?(name) - $stderr.puts(_("group '%s' doesn't exist.") % name) + $stderr.puts(_("group doesn't exist: %s") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-groupshow (+1 -1) =================================================================== --- trunk/bin/asl-groupshow 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-groupshow 2007-09-15 11:30:23 +09:00 (rev 113) @@ -24,7 +24,7 @@ end unless Group.exists?(name) - $stderr.puts(_("group '%s' doesn't exist.") % name) + $stderr.puts(_("group doesn't exist: %s") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-samba-groupadd (+1 -1) =================================================================== --- trunk/bin/asl-samba-groupadd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-groupadd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -33,7 +33,7 @@ end if Group.exists?(name) - $stderr.puts(_("group '%s' already exists.") % name) + $stderr.puts(_("group already exists: %s") % name) exit 1 end Modified: trunk/bin/asl-usershow (+1 -1) =================================================================== --- trunk/bin/asl-usershow 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-usershow 2007-09-15 11:30:23 +09:00 (rev 113) @@ -24,7 +24,7 @@ end unless User.exists?(name) - $stderr.puts(_("user '%s' doesn't exist.") % name) + $stderr.puts(_("user doesn't exist: %s") % name) exit 1 end user = User.find(name) Modified: trunk/bin/asl-samba-groupmod (+1 -1) =================================================================== --- trunk/bin/asl-samba-groupmod 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-groupmod 2007-09-15 11:30:23 +09:00 (rev 113) @@ -45,7 +45,7 @@ end unless Group.exists?(name) - $stderr.puts(_("group '%s' doesn't exist.") % name) + $stderr.puts(_("group doesn't exist: %s") % name) exit 1 end group = Group.find(name) Modified: trunk/bin/asl-samba-userdel (+1 -1) =================================================================== --- trunk/bin/asl-samba-userdel 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-userdel 2007-09-15 11:30:23 +09:00 (rev 113) @@ -37,7 +37,7 @@ end unless User.exists?(name) - $stderr.puts(_("user '%s' doesn't exist.") % name) + $stderr.puts(_("user doesn't exist: %s") % name) exit 1 end Modified: trunk/bin/asl-passwd (+1 -1) =================================================================== --- trunk/bin/asl-passwd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-passwd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -49,7 +49,7 @@ end unless User.exists?(name) - $stderr.puts(_("user '%s' doesn't exist.") % name) + $stderr.puts(_("user doesn't exist: %s") % name) exit 1 end user = User.find(name) Modified: trunk/bin/asl-samba-useradd (+3 -3) =================================================================== --- trunk/bin/asl-samba-useradd 2007-09-14 22:16:35 +09:00 (rev 112) +++ trunk/bin/asl-samba-useradd 2007-09-15 11:30:23 +09:00 (rev 113) @@ -54,12 +54,12 @@ end unless User.valid_name?(name) - $stderr.puts(_("'%s' is illegal user name.") % name) + $stderr.puts(_("illegal user name: %s") % name) exit 1 end if User.exists?(name) - $stderr.puts(_("user '%s' already exists.") % name) + $stderr.puts(_("user already exists: %s") % name) exit 1 end @@ -72,7 +72,7 @@ begin user = User.create(:uid => name, :group_class => Group) rescue ActiveSambaLdap::UidNumberAlreadyExists - $stderr.puts(_("UID '%s' already exists.") % uid_number) + $stderr.puts(_("UID already exists: %s") % uid_number) exit 1 rescue ActiveSambaLdap::GidNumberDoesNotExist, ActiveSambaLdap::GroupDoesNotExist, From null at cozmixng.org Sun Sep 16 05:40:35 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 18:40:35 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r115: Message-ID: <20070916094035.2D1839BE2D@www.cozmixng.org> retro 2007-09-16 18:40:33 +0900 (Sun, 16 Sep 2007) New Revision: 115 Modified files: trunk/po/ja/active-samba-ldap.po Log: Modified: trunk/po/ja/active-samba-ldap.po (+2 -2) =================================================================== --- trunk/po/ja/active-samba-ldap.po 2007-09-16 18:31:58 +09:00 (rev 114) +++ trunk/po/ja/active-samba-ldap.po 2007-09-16 18:40:33 +09:00 (rev 115) @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.3\n" "POT-Creation-Date: 2007-09-16 18:30+0900\n" -"PO-Revision-Date: 2007-09-16 18:31+0900\n" +"PO-Revision-Date: 2007-09-16 18:33+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=1; plural=0;\n" #: lib/active_samba_ldap/command.rb:19 msgid "Common options:" From null at cozmixng.org Sun Sep 16 05:40:32 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 18:40:32 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r114: Message-ID: <20070916094032.6211F9BE23@www.cozmixng.org> retro 2007-09-16 18:40:31 +0900 (Sun, 16 Sep 2007) New Revision: 114 Modified files: trunk/bin/asl-passwd trunk/bin/asl-usermod trunk/po/ja/active-samba-ldap.po Log: Modified: trunk/po/ja/active-samba-ldap.po (+360 -5) =================================================================== --- trunk/po/ja/active-samba-ldap.po 2007-09-15 11:25:16 +09:00 (rev 113) +++ trunk/po/ja/active-samba-ldap.po 2007-09-16 18:40:31 +09:00 (rev 114) @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.3\n" -"POT-Creation-Date: 2007-09-08 12:08+0900\n" -"PO-Revision-Date: 2007-09-08 12:09+0900\n" +"POT-Creation-Date: 2007-09-16 18:30+0900\n" +"PO-Revision-Date: 2007-09-16 18:31+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -48,15 +48,16 @@ #: lib/active_samba_ldap/base.rb:27 msgid "uid number already exists: %s" -msgstr "UID???????????: %s" +msgstr "???????UID????: %s" -#: lib/active_samba_ldap/base.rb:35 +#: lib/active_samba_ldap/base.rb:35 bin/asl-groupdel:46 bin/asl-groupshow:27 +#: bin/asl-samba-groupmod:48 bin/asl-groupmod:59 bin/asl-samba-groupdel:40 msgid "group doesn't exist: %s" msgstr "???????????: %s" #: lib/active_samba_ldap/base.rb:43 msgid "gid number already exists: %s" -msgstr "GID???????????: %s" +msgstr "???????GID????: %s" #: lib/active_samba_ldap/base.rb:51 msgid "gid number doesn't exist: %s" @@ -108,3 +109,357 @@ msgstr "" "%s??????'script/generator scaffold_active_samba_ldap'????????" "??" + +#: bin/asl-samba-useradd:14 bin/asl-samba-computeradd:14 bin/asl-useradd:42 +msgid "add the user in the organizational unit OU" +msgstr "????????OU???" + +#: bin/asl-samba-useradd:15 bin/asl-samba-computeradd:15 bin/asl-useradd:43 +msgid "(relative to the user suffix)" +msgstr "(????????????)" + +#: bin/asl-samba-useradd:33 bin/asl-samba-userdel:21 bin/asl-userdel:42 +#: bin/asl-groupdel:27 bin/asl-samba-computeradd:33 bin/asl-useradd:144 +#: bin/asl-samba-groupmod:29 bin/asl-populate:60 bin/asl-groupmod:40 +#: bin/asl-samba-groupadd:21 bin/asl-purge:16 bin/asl-samba-groupdel:21 +#: bin/asl-groupadd:33 +msgid "need root authority." +msgstr "???????????" + +#: bin/asl-samba-useradd:57 +msgid "illegal user name: %s" +msgstr "???????: %s" + +#: bin/asl-samba-useradd:62 +msgid "user already exists: %s" +msgstr "????????????: %s" + +#: bin/asl-samba-useradd:75 bin/asl-samba-computeradd:78 bin/asl-useradd:224 +msgid "UID already exists: %s" +msgstr "???????UID????: %s" + +#: bin/asl-samba-userdel:40 bin/asl-passwd:52 bin/asl-usershow:27 +msgid "user doesn't exist: %s" +msgstr "??????????: %s" + +#: bin/asl-userdel:16 bin/asl-useradd:51 bin/asl-samba-usermod:15 +#: bin/asl-usermod:44 +msgid "is a Windows Workstation" +msgstr "Windows?????????" + +#: bin/asl-userdel:17 bin/asl-useradd:52 bin/asl-samba-usermod:16 +#: bin/asl-usermod:45 +msgid "(otherwise, Windows user)" +msgstr "(????????Windows???)" + +#: bin/asl-userdel:21 +msgid "remove home directory" +msgstr "????????????" + +#: bin/asl-userdel:27 +msgid "do interactively" +msgstr "??????" + +#: bin/asl-userdel:62 bin/asl-useradd:169 bin/asl-samba-usermod:48 +#: bin/asl-usermod:162 +msgid "computer" +msgstr "??????" + +#: bin/asl-userdel:65 bin/asl-useradd:173 bin/asl-samba-usermod:51 +#: bin/asl-usermod:166 +msgid "user" +msgstr "???" + +#: bin/asl-userdel:73 bin/asl-samba-usermod:59 bin/asl-usermod:170 +msgid "%s doesn't exist: %s" +msgstr "%s???????: %s" + +#: bin/asl-groupdel:14 +msgid "force delete group" +msgstr "???????????" + +#: bin/asl-samba-computeradd:57 +msgid "illegal computer name: %s" +msgstr "??????????: %s" + +#: bin/asl-samba-computeradd:62 +msgid "computer already exists: %s" +msgstr "???????????????: %s" + +#: bin/asl-passwd:17 +msgid "update samba password" +msgstr "Samba?????????" + +#: bin/asl-passwd:23 +msgid "update UNIX password" +msgstr "UNIX?????????" + +#: bin/asl-passwd:41 +msgid "do nothing." +msgstr "???????" + +#: bin/asl-passwd:58 +msgid "Enter your current password: " +msgstr "?????????????????: " + +#: bin/asl-passwd:68 +msgid "password doesn't match." +msgstr "??????????????" + +#: bin/asl-passwd:75 +msgid "New password: " +msgstr "????????: " + +#: bin/asl-passwd:76 +msgid "Retype new password: " +msgstr "?????????????????????: " + +#: bin/asl-passwd:79 +msgid "New passwords don't match." +msgstr "?????????????????" + +#: bin/asl-useradd:54 bin/asl-usermod:60 +msgid "uid" +msgstr "UID??" + +#: bin/asl-useradd:55 bin/asl-samba-usermod:19 +msgid "gid" +msgstr "GID??" + +#: bin/asl-useradd:57 bin/asl-usermod:68 +msgid "supplementary groups (comma separated)" +msgstr "??????(??????)" + +#: bin/asl-useradd:61 +msgid "create a group for the user" +msgstr "??????????????" + +#: bin/asl-useradd:64 +msgid "set the GECOS field for the new user account" +msgstr "????????????GECOS??????????" + +#: bin/asl-useradd:65 bin/asl-usermod:74 +msgid "shell" +msgstr "???" + +#: bin/asl-useradd:66 bin/asl-usermod:75 +msgid "given name" +msgstr "??" + +#: bin/asl-useradd:68 bin/asl-usermod:77 +msgid "common name" +msgstr "???" + +#: bin/asl-useradd:69 bin/asl-usermod:78 +msgid "surname" +msgstr "?" + +#: bin/asl-useradd:72 bin/asl-usermod:50 +msgid "home directory" +msgstr "?????????" + +#: bin/asl-useradd:74 +msgid "permission of home directory" +msgstr "?????????????????" + +#: bin/asl-useradd:76 +msgid "setup home directory" +msgstr "??????????????" + +#: bin/asl-useradd:79 +msgid "skeleton directory" +msgstr "????????????????????" + +#: bin/asl-useradd:82 +msgid "wait TIME seconds before exiting" +msgstr "??????TIME???" + +#: bin/asl-useradd:86 bin/asl-usermod:81 +msgid "For samba accounts:" +msgstr "Samba??????:" + +#: bin/asl-useradd:88 bin/asl-usermod:83 +msgid "expire date" +msgstr "???" + +#: bin/asl-useradd:92 bin/asl-usermod:87 +msgid "can change password" +msgstr "????????????????" + +#: bin/asl-useradd:96 bin/asl-usermod:91 +msgid "must change password" +msgstr "??????????????????????" + +#: bin/asl-useradd:100 bin/asl-usermod:95 +msgid "sambaHomePath" +msgstr "sambaHomePath" + +#: bin/asl-useradd:101 bin/asl-usermod:96 +msgid "(SMB home share, like '\\\\PDC\\user'" +msgstr "(SMB???????: '\\\\PDC\\user')" + +#: bin/asl-useradd:105 bin/asl-usermod:100 +msgid "sambaHomeDrive" +msgstr "sambaHomeDrive" + +#: bin/asl-useradd:106 bin/asl-usermod:101 +msgid "(letter associated with home share, like 'H:')" +msgstr "(???????????????: 'H:')" + +#: bin/asl-useradd:110 bin/asl-usermod:105 +msgid "sambaLogonScript" +msgstr "sambaLogonScript" + +#: bin/asl-useradd:111 bin/asl-usermod:106 +msgid "(DOS script to execute on login)" +msgstr "(??????????DOS?????)" + +#: bin/asl-useradd:115 bin/asl-usermod:110 +msgid "sambaProfilePath" +msgstr "sambaProfilePath" + +#: bin/asl-useradd:116 bin/asl-usermod:111 +msgid "(profile directory, like '\\\\PDC\\profiles\\user')" +msgstr "(??????????????: '\\\\PDC\\profiles\\user')" + +#: bin/asl-useradd:120 bin/asl-usermod:116 +msgid "sambaAcctFlags" +msgstr "sambaAcctFlags" + +#: bin/asl-useradd:121 bin/asl-usermod:117 +msgid "(samba account control bits, like '[NDHTUMWSLXI]')" +msgstr "(Samba?????????????: '[NDHTUMWSLXI]')" + +#: bin/asl-useradd:177 +msgid "illegal %s name: %s" +msgstr "???%s?: %s" + +#: bin/asl-useradd:182 bin/asl-usermod:314 +msgid "%s already exists: %s" +msgstr "???????%s??: %s" + +#: bin/asl-samba-groupmod:15 bin/asl-groupmod:26 +msgid "add members (comma delimited)" +msgstr "?????????(??????)" + +#: bin/asl-samba-groupmod:17 bin/asl-groupmod:28 +msgid "delete members (comma delimited)" +msgstr "?????????(??????)" + +#: bin/asl-samba-groupmod:56 +msgid "there are duplicated members in adding and deleting members: %s" +msgstr "??????????????????????????????: %s" + +#: bin/asl-samba-usermod:65 bin/asl-usermod:176 +msgid "Enter your password: " +msgstr "??????????????????: " + +#: bin/asl-samba-usermod:74 bin/asl-usermod:185 +msgid "password isn't match." +msgstr "??????????????" + +#: bin/asl-populate:30 +msgid "first uid number to allocate" +msgstr "????????UID??" + +#: bin/asl-populate:33 +msgid "first gid number to allocate" +msgstr "????????GID??" + +#: bin/asl-populate:36 +msgid "administrator login name" +msgstr "?????????" + +#: bin/asl-populate:39 +msgid "administrator's uid number" +msgstr "????UID??" + +#: bin/asl-populate:42 +msgid "administrator's gid number" +msgstr "????GID??" + +#: bin/asl-populate:45 +msgid "guest login name" +msgstr "?????????" + +#: bin/asl-populate:48 +msgid "guest's uid number" +msgstr "????UID??" + +#: bin/asl-populate:51 +msgid "guest's gid number" +msgstr "????GID??" + +#: bin/asl-populate:54 +msgid "export LDIF file" +msgstr "LDIF?????????" + +#: bin/asl-populate:76 +msgid "Password for %s: " +msgstr "%s??????: " + +#: bin/asl-populate:78 +msgid "Retype password for %s: " +msgstr "%s????????????????:" + +#: bin/asl-populate:81 +msgid "Passwords don't match." +msgstr "??????????????" + +#: bin/asl-groupmod:19 +msgid "gid can be non unique" +msgstr "GID??????????" + +#: bin/asl-groupmod:24 +msgid "new group name" +msgstr "????????" + +#: bin/asl-groupmod:79 +msgid "there is duplicated member in adding and deleting members: %s" +msgid_plural "there are duplicated members in adding and deleting members: %s" +msgstr[0] "??????????????????????????????: %s" +msgstr[1] "??????????????????????????????: %s" + +#: bin/asl-groupmod:117 bin/asl-samba-groupadd:36 bin/asl-groupadd:48 +msgid "group already exists: %s" +msgstr "?????????????: %s" + +#: bin/asl-usermod:48 +msgid "gecos" +msgstr "GECOS" + +#: bin/asl-usermod:52 +msgid "move home directory" +msgstr "??????????????" + +#: bin/asl-usermod:57 +msgid "new user name (cn and dn are updated)" +msgstr "???????(CN?DN???)" + +#: bin/asl-usermod:62 +msgid "uid can be non unique " +msgstr "UID????????" + +#: bin/asl-usermod:72 +msgid "replace supplementary groups " +msgstr "????????????" + +#: bin/asl-usermod:119 +msgid "disable this user" +msgstr "???????????" + +#: bin/asl-usermod:122 +msgid "enable this user" +msgstr "???????????" + +#: bin/asl-usermod:240 bin/asl-usermod:244 +msgid "not implemented." +msgstr "??????????" + +#: bin/asl-groupadd:17 +msgid "group type" +msgstr "???????" + +#: bin/asl-groupadd:20 +msgid "print the gid number to stdout" +msgstr "GID????????????" Modified: trunk/bin/asl-usermod (+2 -2) =================================================================== --- trunk/bin/asl-usermod 2007-09-15 11:25:16 +09:00 (rev 113) +++ trunk/bin/asl-usermod 2007-09-16 18:40:31 +09:00 (rev 114) @@ -237,11 +237,11 @@ end if options.mail_addresses - raise _("not implemented") + raise _("not implemented.") end if options.mail_to_addresses - raise _("not implemented") + raise _("not implemented.") end if options.supplementary_groups Modified: trunk/bin/asl-passwd (+1 -1) =================================================================== --- trunk/bin/asl-passwd 2007-09-15 11:25:16 +09:00 (rev 113) +++ trunk/bin/asl-passwd 2007-09-16 18:40:31 +09:00 (rev 114) @@ -65,7 +65,7 @@ :password => old_password, :allow_anonymous => false)) rescue ActiveLdap::AuthenticationError - $stderr.puts(_("password isn't match.")) + $stderr.puts(_("password doesn't match.")) exit 1 ensure auth_class.remove_connection From null at cozmixng.org Sun Sep 16 09:10:27 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:10:27 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r116: Message-ID: <20070916131027.82BFC9BEB2@www.cozmixng.org> retro 2007-09-16 22:10:25 +0900 (Sun, 16 Sep 2007) New Revision: 116 Modified files: trunk/bin/asl-passwd trunk/lib/active_samba_ldap/command.rb trunk/po/ja/active-samba-ldap.po trunk/test/asl-test-utils.rb trunk/test/command.rb trunk/test/run-test.rb trunk/test/test_asl_groupadd.rb trunk/test/test_asl_groupdel.rb trunk/test/test_asl_groupmod.rb trunk/test/test_asl_groupshow.rb trunk/test/test_asl_passwd.rb trunk/test/test_asl_populate.rb trunk/test/test_asl_purge.rb trunk/test/test_asl_useradd.rb trunk/test/test_asl_userdel.rb trunk/test/test_asl_usermod.rb trunk/test/test_asl_usershow.rb Log: Modified: trunk/test/test_asl_groupshow.rb (+1 -1) =================================================================== --- trunk/test/test_asl_groupshow.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_groupshow.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -15,7 +15,7 @@ end def test_not_exist_group - assert_equal([false, "", "group 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("group doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end end Modified: trunk/test/test_asl_groupmod.rb (+7 -6) =================================================================== --- trunk/test/test_asl_groupmod.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_groupmod.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,7 +9,7 @@ end def test_not_exist_group - assert_equal([false, "", "group 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("group doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end @@ -120,7 +120,7 @@ new_rid = (2 * Integer(new_gid_number) + 1001).to_s new_samba_sid = old_samba_sid.sub(/#{Regexp.escape(old_rid)}$/, new_rid) - message = "gid number '#{new_gid_number}' already exists\n" + message = _("gid number already exists: %s") % new_gid_number + "\n" args = ["--gid", new_gid_number] assert_asl_groupmod_failed(group.cn, message, *args) @@ -225,19 +225,20 @@ def test_duplicate_members make_dummy_group do |group| - base = "there are duplicated members in adding and deleting members:" + format = _("there are duplicated members in " \ + "adding and deleting members: %s") assert_asl_groupmod_failed(group.cn, - "#{base} user\n", + "#{format % 'user'}\n", "--add-members", "user", "--delete-members", "user") assert_asl_groupmod_failed(group.cn, - "#{base} user2\n", + "#{format % 'user2'}\n", "--add-members", "user1,user2,user3", "--delete-members", "user2") assert_asl_groupmod_failed(group.cn, - "#{base} user2, user3\n", + "#{format % 'user2, user3'}\n", "--add-members", "user1,user2,user3", "--delete-members", "user2,user3,user4") end Modified: trunk/test/test_asl_groupadd.rb (+2 -2) =================================================================== --- trunk/test/test_asl_groupadd.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_groupadd.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,14 +9,14 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_command_as_normal_user("group-name")) end def test_exist_group make_dummy_group do |group| assert(@group_class.exists?(group.cn)) - assert_equal([false, "", "group '#{group.cn}' already exists.\n"], + assert_equal([false, "", _("group already exists: %s") % group.cn + "\n"], run_command(group.cn)) assert(@group_class.exists?(group.cn)) end Modified: trunk/test/asl-test-utils.rb (+1 -1) =================================================================== --- trunk/test/asl-test-utils.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/asl-test-utils.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -246,7 +246,7 @@ @lib_dir = File.join(@top_dir, "lib") @ruby_args = [ "-I", @lib_dir, - "-I", File.join(@parent_dir, "activeldap", "lib"), +# "-I", File.join(@parent_dir, "activeldap", "lib"), # "-I", File.join(@parent_dir, "ldap", "lib"), # "-I", File.join(@parent_dir, "ldap"), ] Modified: trunk/po/ja/active-samba-ldap.po (+2 -2) =================================================================== --- trunk/po/ja/active-samba-ldap.po 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/po/ja/active-samba-ldap.po 2007-09-16 22:10:25 +09:00 (rev 116) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Ruby/ActiveSambaLdap 0.0.3\n" "POT-Creation-Date: 2007-09-16 18:30+0900\n" -"PO-Revision-Date: 2007-09-16 18:33+0900\n" +"PO-Revision-Date: 2007-09-16 20:25+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -184,7 +184,7 @@ #: bin/asl-samba-computeradd:62 msgid "computer already exists: %s" -msgstr "???????????????: %s" +msgstr "???????????????: %s" #: bin/asl-passwd:17 msgid "update samba password" Modified: trunk/test/test_asl_groupdel.rb (+11 -11) =================================================================== --- trunk/test/test_asl_groupdel.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_groupdel.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,12 +9,12 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_command_as_normal_user("group-name")) end def test_not_exist_group - assert_equal([false, "", "group 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("group doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end @@ -36,9 +36,9 @@ def test_primary_group_of_user make_dummy_group do |group| make_dummy_user(:gid_number => group.gid_number) do |user, password| - message = "cannot destroy group '#{group.cn}' due to members " - message << "who belong to the group as primary group" - message << ": #{user.uid}\n" + format = _("cannot destroy group '%s' due to members " \ + "who belong to the group as primary group: %s") + message = format % [group.cn, user.uid] + "\n" assert_equal([false, "", message], run_command(group.cn)) end end @@ -47,9 +47,9 @@ def test_primary_group_of_user_with_force make_dummy_group do |group| make_dummy_user(:gid_number => group.gid_number) do |user, password| - message = "cannot change primary group from '#{group.cn}' " - message << "to other group due to no other belonged groups" - message << ": #{user.uid}\n" + format = _("cannot change primary group from '%s' " \ + "to other group due to no other belonged groups: %s") + message = format % [group.cn, user.uid] + "\n" assert_equal([false, "", message], run_command(group.cn, "--force")) end end @@ -75,9 +75,9 @@ make_dummy_group do |group2| group2.users << user assert_equal(group.gid_number, user.gid_number) - message = "cannot destroy group '#{group.cn}' due to members " - message << "who belong to the group as primary group" - message << ": #{user.uid}\n" + format = _("cannot destroy group '%s' due to members " \ + "who belong to the group as primary group: %s") + message = format % [group.cn, user.uid] + "\n" assert_equal([false, "", message], run_command(group.cn)) user.reload assert_equal(group.gid_number, user.gid_number) Modified: trunk/test/test_asl_purge.rb (+1 -1) =================================================================== --- trunk/test/test_asl_purge.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_purge.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,7 +9,7 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_command_as_normal_user) end Modified: trunk/test/command.rb (+5 -2) =================================================================== --- trunk/test/command.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/command.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -1,6 +1,7 @@ require "thread" require "socket" require "shellwords" +require "timeout" module Command class Error < StandardError @@ -58,7 +59,9 @@ in_r.close unless in_r.closed? out_w.close unless out_w.closed? err_w.close unless err_w.closed? - pid, status = Process.waitpid2(pid) - [status.exited? && status.exitstatus.zero?, out_r.read, err_r.read] + Timeout.timeout(5) do + pid, status = Process.waitpid2(pid) + [status.exited? && status.exitstatus.zero?, out_r.read, err_r.read] + end end end Modified: trunk/test/test_asl_usermod.rb (+8 -8) =================================================================== --- trunk/test/test_asl_usermod.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_usermod.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,7 +9,7 @@ end def test_not_exist_user - assert_equal([false, "", "user 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end @@ -106,7 +106,7 @@ new_rid = (2 * Integer(new_uid_number) + 1000).to_s new_samba_sid = old_samba_sid.sub(/#{Regexp.escape(old_rid)}$/, new_rid) - message = "uid number '#{new_uid_number}' already exists\n" + message = _("uid number already exists: %s") % new_uid_number + "\n" args = ["--uid", new_uid_number] assert_asl_usermod_failed(user.uid, password, message, *args) @@ -163,7 +163,7 @@ group.destroy args = ["--gid", new_gid_number] - message = "gid number '#{new_gid_number}' doesn't exist\n" + message = _("gid number doesn't exist: %s") % new_gid_number + "\n" assert_asl_usermod_failed(user.uid, password, message, *args) new_user = @user_class.find(user.uid) @@ -270,7 +270,7 @@ :value => user.uid) args = ["--groups", new_gid_numbers.join(",")] - message = "gid number '#{new_gid_numbers[0]}' doesn't exist\n" + message = _("gid number doesn't exist: %s") % new_gid_numbers[0] + "\n" assert_asl_usermod_failed(user.uid, password, message, *args) new_user = @user_class.find(user.uid) @@ -299,12 +299,12 @@ end end - def test_canonical_name + def test_common_name make_dummy_user do |user, password| old_cn = user.cn new_cn = "new-#{new_cn}" - args = ["--canonical-name", new_cn] + args = ["--common-name", new_cn] assert_asl_usermod_successfully(user.uid, password, *args) new_user = @user_class.find(user.uid) @@ -523,7 +523,7 @@ private def assert_asl_usermod_successfully(name, password, *args) args << name - assert_equal([true, "Enter your password: \n", ""], + assert_equal([true, _("Enter your password: ") + "\n", ""], run_command_as_normal_user(*args) do |input, output| output.puts password output.puts password @@ -532,7 +532,7 @@ def assert_asl_usermod_failed(name, password, message, *args) args << name - assert_equal([false, "Enter your password: \n", message], + assert_equal([false, _("Enter your password: ") + "\n", message], run_command_as_normal_user(*args) do |input, output| output.puts password output.puts password Modified: trunk/test/test_asl_useradd.rb (+11 -9) =================================================================== --- trunk/test/test_asl_useradd.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_useradd.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,9 +9,9 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_asl_useradd_as_normal_user("user-name")) - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_asl_useradd_as_normal_user("computer-name$", "--computer-account")) end @@ -19,7 +19,7 @@ def test_exist_user make_dummy_user do |user, password| assert(@user_class.exists?(user.uid)) - assert_equal([false, "", "user '#{user.uid}' already exists.\n"], + assert_equal([false, "", _("user already exists: %s") % user.uid + "\n"], run_asl_useradd(user.uid)) assert(@user_class.exists?(user.uid)) end @@ -29,7 +29,8 @@ make_dummy_computer do |computer, password| uid = computer.uid assert(@computer_class.exists?(uid)) - assert_equal([false, "", "computer '#{uid}' already exists.\n"], + assert_equal([false, "", + _("%s already exists: %s") % [_("computer"), uid] + "\n"], run_asl_useradd(uid, "--computer-account")) assert(@computer_class.exists?(uid)) end @@ -250,10 +251,10 @@ end end - def test_canonical_name_user + def test_common_name_user ensure_delete_user("test-user") do |uid,| cn = "John Kennedy" - assert_asl_useradd_successfully(uid, "--canonical-name", cn) + assert_asl_useradd_successfully(uid, "--common-name", cn) user = @user_class.find(uid) assert_equal(uid, user.given_name) assert_equal(uid, user.surname) @@ -261,11 +262,12 @@ end end - def test_canonical_name_computer + def test_common_name_computer ensure_delete_computer("test-computer$") do |uid,| cn = "A computer" - assert_asl_useradd_successfully(uid, "--computer-account", - "--canonical-name", cn) + assert_asl_useradd_successfully(uid, + "--computer-account", + "--common-name", cn) computer = @computer_class.find(uid) assert_equal(uid, computer.given_name) assert_equal(uid, computer.surname) Modified: trunk/lib/active_samba_ldap/command.rb (+3 -1) =================================================================== --- trunk/lib/active_samba_ldap/command.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/lib/active_samba_ldap/command.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -52,7 +52,9 @@ def read_password(prompt, input=$stdin, output=$stdout) output.print prompt system "/bin/stty -echo" if input.tty? - input.gets.chomp + password = input.gets + password = password.chomp if password + password ensure system "/bin/stty echo" if input.tty? output.puts Modified: trunk/test/test_asl_userdel.rb (+6 -4) =================================================================== --- trunk/test/test_asl_userdel.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_userdel.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,12 +9,12 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_command_as_normal_user("user-name")) end def test_not_exist_user - assert_equal([false, "", "user 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end @@ -38,7 +38,8 @@ def test_user_as_computer make_dummy_user do |user, password| - assert_equal([false, "", "computer '#{user.uid}$' doesn't exist.\n"], + message = _("%s doesn't exist: %s") % [_("computer"), "#{user.uid}$"] + assert_equal([false, "", "#{message}\n"], run_command(user.uid, "--computer-account")) assert(@user_class.exists?(user.uid)) end @@ -46,7 +47,8 @@ def test_computer_as_user make_dummy_computer do |computer, password| - assert_equal([false, "", "user '#{computer.uid}' doesn't exist.\n"], + message = _("%s doesn't exist: %s") % [_("user"), computer.uid] + assert_equal([false, "", "#{message}\n"], run_command(computer.uid)) assert(@computer_class.exists?(computer.uid)) end Modified: trunk/test/test_asl_populate.rb (+6 -6) =================================================================== --- trunk/test/test_asl_populate.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_populate.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,7 +9,7 @@ end def test_run_as_normal_user - assert_equal([false, "", "need root authority.\n"], + assert_equal([false, "", _("need root authority.") + "\n"], run_command_as_normal_user) end @@ -63,8 +63,8 @@ name ||= @user_class::DOMAIN_ADMIN_NAME assert_equal([true, [ - "Password for #{name}: ", - "Retype password for #{name}: ", + _("Password for %s: ") % name, + _("Retype password for %s: ") % name, ].join("\n") + "\n", "", ], @@ -79,10 +79,10 @@ password = "password" assert_equal([false, [ - "Password for #{name}: ", - "Retype password for #{name}: ", + _("Password for %s: ") % name, + _("Retype password for %s: ") % name, ].join("\n") + "\n", - "Passwords don't match.\n", + _("Passwords don't match.") + "\n", ], run_command(*args) do |input, output| output.puts(password) Modified: trunk/test/run-test.rb (+5 -1) =================================================================== --- trunk/test/run-test.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/run-test.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -7,12 +7,16 @@ top_dir = File.join(File.dirname(__FILE__), "..") # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap", "lib")) # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap")) -$LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib")) +# $LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib")) $LOAD_PATH.unshift(File.join(top_dir, "lib")) $LOAD_PATH.unshift(File.join(top_dir, "test")) require 'test-unit-ext' +unless ARGV.find {|opt| /\A--(?:no-)?priority/ =~ opt} + ARGV << "--priority" +end + if Test::Unit::AutoRunner.respond_to?(:standalone?) exit Test::Unit::AutoRunner.run($0, File.dirname($0)) else Modified: trunk/test/test_asl_passwd.rb (+11 -10) =================================================================== --- trunk/test/test_asl_passwd.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_passwd.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -9,7 +9,7 @@ end def test_unknown_user - assert_equal([false, "", "user 'unknown' doesn't exist.\n"], + assert_equal([false, "", _("user doesn't exist: %s") % 'unknown' + "\n"], run_command("unknown")) end @@ -103,9 +103,9 @@ *args) assert_equal([true, [ - "Enter your current password: ", - "New password: ", - "Retype new password: ", + _("Enter your current password: "), + _("New password: "), + _("Retype new password: "), ].join("\n") + "\n", "", ], @@ -113,13 +113,14 @@ end def assert_change_password_with_wrong_current_password(name, password, *args) + input_password = Proc.new do |input, output| + output.puts(password) + output.flush + end assert_equal([false, - "Enter your current password: \n", - "password isn't match\n", + _("Enter your current password: ") + "\n", + _("password doesn't match.") + "\n", ], - run_command_as_normal_user(name, *args) do |input, output| - output.puts(password) - output.flush - end) + run_command_as_normal_user(name, *args, &input_password)) end end Modified: trunk/bin/asl-passwd (+1 -2) =================================================================== --- trunk/bin/asl-passwd 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/bin/asl-passwd 2007-09-16 22:10:25 +09:00 (rev 116) @@ -64,11 +64,10 @@ auth_class.establish_connection(config.merge(:bind_dn => user.dn, :password => old_password, :allow_anonymous => false)) + auth_class.remove_connection rescue ActiveLdap::AuthenticationError $stderr.puts(_("password doesn't match.")) exit 1 - ensure - auth_class.remove_connection end end Modified: trunk/test/test_asl_usershow.rb (+1 -1) =================================================================== --- trunk/test/test_asl_usershow.rb 2007-09-16 18:33:57 +09:00 (rev 115) +++ trunk/test/test_asl_usershow.rb 2007-09-16 22:10:25 +09:00 (rev 116) @@ -21,7 +21,7 @@ end def test_not_exist_user - assert_equal([false, "", "user 'not-exist' doesn't exist.\n"], + assert_equal([false, "", _("user doesn't exist: %s") % 'not-exist' + "\n"], run_command("not-exist")) end end From null at cozmixng.org Sun Sep 16 09:10:31 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:10:31 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r117: Message-ID: <20070916131031.6D6AD9BEB3@www.cozmixng.org> retro 2007-09-16 22:10:29 +0900 (Sun, 16 Sep 2007) New Revision: 117 Modified files: trunk/lib/active_samba_ldap/version.rb Log: Modified: trunk/lib/active_samba_ldap/version.rb (+1 -1) =================================================================== --- trunk/lib/active_samba_ldap/version.rb 2007-09-16 22:07:57 +09:00 (rev 116) +++ trunk/lib/active_samba_ldap/version.rb 2007-09-16 22:10:29 +09:00 (rev 117) @@ -1,3 +1,3 @@ module ActiveSambaLdap - VERSION = "0.0.3" + VERSION = "0.0.4" end From null at cozmixng.org Sun Sep 16 09:20:22 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:20:22 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r118: Message-ID: <20070916132022.562559BE4C@www.cozmixng.org> retro 2007-09-16 22:20:20 +0900 (Sun, 16 Sep 2007) New Revision: 118 Modified files: trunk/README.en trunk/README.ja Log: Modified: trunk/README.en (+2 -0) =================================================================== --- trunk/README.en 2007-09-16 22:09:43 +09:00 (rev 117) +++ trunk/README.en 2007-09-16 22:20:20 +09:00 (rev 118) @@ -328,3 +328,5 @@ SUBSTR caseExactIA5SubstringsMatch == Thanks + + * Henrik Kr?g: He reported some bugs. Modified: trunk/README.ja (+2 -0) =================================================================== --- trunk/README.ja 2007-09-16 22:09:43 +09:00 (rev 117) +++ trunk/README.ja 2007-09-16 22:20:20 +09:00 (rev 118) @@ -323,3 +323,5 @@ SUBSTR caseExactIA5SubstringsMatch == ?? + + * Henrik Kr?g: ????????????? From null at cozmixng.org Sun Sep 16 09:20:25 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:20:25 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r119: Message-ID: <20070916132025.101979BE57@www.cozmixng.org> retro 2007-09-16 22:20:23 +0900 (Sun, 16 Sep 2007) New Revision: 119 Modified files: trunk/NEWS.en trunk/NEWS.ja Log: Modified: trunk/NEWS.ja (+7 -0) =================================================================== --- trunk/NEWS.ja 2007-09-16 22:13:37 +09:00 (rev 118) +++ trunk/NEWS.ja 2007-09-16 22:20:23 +09:00 (rev 119) @@ -4,6 +4,13 @@ $Id$ +== 0.0.4: 2007-09-16 + + * Ruby/ActiveLdap 0.8.3.1??? + * Ruby-GetText-Package??? + * scaffold_asl -> scaffold_active_samba_ldap + * Rails?????? + == 0.0.3: 2007-05-26 * Ruby/ActiveLDAP?RubyGems????? Modified: trunk/NEWS.en (+7 -0) =================================================================== --- trunk/NEWS.en 2007-09-16 22:13:37 +09:00 (rev 118) +++ trunk/NEWS.en 2007-09-16 22:20:23 +09:00 (rev 119) @@ -4,6 +4,13 @@ $Id$ +== 0.0.4: 2007-09-16 + + * Supported Ruby/ActiveLdap 0.8.3.1. + * Supported Ruby-GetText-Package. + * scaffold_asl -> scaffold_active_samba_ldap + * Improved Rails support. + == 0.0.3: 2007-05-26 * Fixed a typo of Ruby/ActiveLDAP's RubyGems name. From null at cozmixng.org Sun Sep 16 09:20:27 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:20:27 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r120: Message-ID: <20070916132027.9532C9BEB5@www.cozmixng.org> retro 2007-09-16 22:20:26 +0900 (Sun, 16 Sep 2007) New Revision: 120 Modified files: trunk/README.en trunk/README.ja Log: Modified: trunk/README.en (+1 -1) =================================================================== --- trunk/README.en 2007-09-16 22:14:27 +09:00 (rev 119) +++ trunk/README.en 2007-09-16 22:20:26 +09:00 (rev 120) @@ -37,7 +37,7 @@ == Dependency libraries - * ActiveLdap >= 0.8.2 + * ActiveLdap >= 0.8.3.1 == Usage Modified: trunk/README.ja (+1 -1) =================================================================== --- trunk/README.ja 2007-09-16 22:14:27 +09:00 (rev 119) +++ trunk/README.ja 2007-09-16 22:20:26 +09:00 (rev 120) @@ -34,7 +34,7 @@ == ??????? - * ActiveLdap >= 0.8.2 + * ActiveLdap >= 0.8.3.1 == ??? From null at cozmixng.org Sun Sep 16 09:30:26 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:30:26 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r121: Message-ID: <20070916133026.76C199BE26@www.cozmixng.org> retro 2007-09-16 22:30:24 +0900 (Sun, 16 Sep 2007) New Revision: 121 Modified files: trunk/bin/asl-groupadd trunk/bin/asl-groupmod trunk/po/ja/active-samba-ldap.po Log: Modified: trunk/po/ja/active-samba-ldap.po (+11 -7) =================================================================== --- trunk/po/ja/active-samba-ldap.po 2007-09-16 22:17:37 +09:00 (rev 120) +++ trunk/po/ja/active-samba-ldap.po 2007-09-16 22:30:24 +09:00 (rev 121) @@ -6,9 +6,9 @@ # msgid "" msgstr "" -"Project-Id-Version: Ruby/ActiveSambaLdap 0.0.3\n" -"POT-Creation-Date: 2007-09-16 18:30+0900\n" -"PO-Revision-Date: 2007-09-16 20:25+0900\n" +"Project-Id-Version: Ruby/ActiveSambaLdap 0.0.4\n" +"POT-Creation-Date: 2007-09-16 22:22+0900\n" +"PO-Revision-Date: 2007-09-16 22:21+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -202,19 +202,19 @@ msgid "Enter your current password: " msgstr "?????????????????: " -#: bin/asl-passwd:68 +#: bin/asl-passwd:69 msgid "password doesn't match." msgstr "??????????????" -#: bin/asl-passwd:75 +#: bin/asl-passwd:74 msgid "New password: " msgstr "????????: " -#: bin/asl-passwd:76 +#: bin/asl-passwd:75 msgid "Retype new password: " msgstr "?????????????????????: " -#: bin/asl-passwd:79 +#: bin/asl-passwd:78 msgid "New passwords don't match." msgstr "?????????????????" @@ -406,6 +406,10 @@ msgid "Passwords don't match." msgstr "??????????????" +#: bin/asl-groupmod:17 bin/asl-groupadd:15 +msgid "GID number" +msgstr "GID??" + #: bin/asl-groupmod:19 msgid "gid can be non unique" msgstr "GID??????????" Modified: trunk/bin/asl-groupadd (+1 -1) =================================================================== --- trunk/bin/asl-groupadd 2007-09-16 22:17:37 +09:00 (rev 120) +++ trunk/bin/asl-groupadd 2007-09-16 22:30:24 +09:00 (rev 121) @@ -12,7 +12,7 @@ opts.banner += " GROUP_NAME" - opts.on("-g", "--gid=GID", Integer, "GID number") {|options.gid|} + opts.on("-g", "--gid=GID", Integer, _("GID number")) {|options.gid|} opts.on("-t", "--type=TYPE", _("group type"), "(#{options.group_type})") {|options.group_type|} Modified: trunk/bin/asl-groupmod (+1 -1) =================================================================== --- trunk/bin/asl-groupmod 2007-09-16 22:17:37 +09:00 (rev 120) +++ trunk/bin/asl-groupmod 2007-09-16 22:30:24 +09:00 (rev 121) @@ -14,7 +14,7 @@ opts.banner += " GROUP_NAME" - opts.on("-g", "--gid=GID", "gid") {|options.gid|} + opts.on("-g", "--gid=GID", _("GID number")) {|options.gid|} opts.on("--[no-]allow-non-unique-gid", _("gid can be non unique"), "(#{options.allow_non_unique_gid_number})") do |bool| From null at cozmixng.org Sun Sep 16 09:30:28 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:30:28 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r122: Message-ID: <20070916133028.B081F9BE2D@www.cozmixng.org> retro 2007-09-16 22:30:27 +0900 (Sun, 16 Sep 2007) New Revision: 122 Modified files: trunk/Rakefile Log: Modified: trunk/Rakefile (+3 -0) =================================================================== --- trunk/Rakefile 2007-09-16 22:23:33 +09:00 (rev 121) +++ trunk/Rakefile 2007-09-16 22:30:27 +09:00 (rev 122) @@ -89,7 +89,10 @@ project.bin_files.each do |bin| bin_help = "#{bin}.help" File.open(bin_help, "w") do |f| + lang = ENV["LANG"] + ENV["LANG"] = "C" f.puts(`#{RUBY} -I #{File.join(base_dir, 'lib')} #{bin} --help`) + ENV["LANG"] = lang end at_exit do FileUtils.rm_f(bin_help) From null at cozmixng.org Sun Sep 16 09:30:31 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:30:31 +0900 Subject: [asl-commit] ActiveSambaLdap (0.0.4) r123: Message-ID: <20070916133031.EA93C9BE4E@www.cozmixng.org> retro 2007-09-16 22:30:29 +0900 (Sun, 16 Sep 2007) New Revision: 123 Copied directories: tags/0.0.4/ (from rev 122, trunk/) Log: Copied: tags/0.0.4/ (from rev 122, trunk/) From null at cozmixng.org Sun Sep 16 09:30:34 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:30:34 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r124: Message-ID: <20070916133035.0584E9BE54@www.cozmixng.org> retro 2007-09-16 22:30:32 +0900 (Sun, 16 Sep 2007) New Revision: 124 Modified files: trunk/lib/active_samba_ldap/version.rb Log: Modified: trunk/lib/active_samba_ldap/version.rb (+1 -1) =================================================================== --- trunk/lib/active_samba_ldap/version.rb 2007-09-16 22:28:40 +09:00 (rev 123) +++ trunk/lib/active_samba_ldap/version.rb 2007-09-16 22:30:32 +09:00 (rev 124) @@ -1,3 +1,3 @@ module ActiveSambaLdap - VERSION = "0.0.4" + VERSION = "0.0.5" end From null at cozmixng.org Sun Sep 16 09:50:28 2007 From: null at cozmixng.org (null at cozmixng.org) Date: Sun, 16 Sep 2007 22:50:28 +0900 Subject: [asl-commit] ActiveSambaLdap (trunk) r125: Message-ID: <20070916135029.0C9AB9BE2A@www.cozmixng.org> retro 2007-09-16 22:50:27 +0900 (Sun, 16 Sep 2007) New Revision: 125 Modified files: trunk/bin/asl-passwd trunk/lib/active_samba_ldap.rb trunk/lib/active_samba_ldap/configuration.rb trunk/test/asl-test-utils.rb trunk/test/run-test.rb Log: Modified: trunk/test/asl-test-utils.rb (+1 -1) =================================================================== --- trunk/test/asl-test-utils.rb 2007-09-16 22:29:35 +09:00 (rev 124) +++ trunk/test/asl-test-utils.rb 2007-09-16 22:50:27 +09:00 (rev 125) @@ -246,7 +246,7 @@ @lib_dir = File.join(@top_dir, "lib") @ruby_args = [ "-I", @lib_dir, -# "-I", File.join(@parent_dir, "activeldap", "lib"), + "-I", File.join(@parent_dir, "activeldap", "lib"), # "-I", File.join(@parent_dir, "ldap", "lib"), # "-I", File.join(@parent_dir, "ldap"), ] Modified: trunk/lib/active_samba_ldap.rb (+1 -1) =================================================================== --- trunk/lib/active_samba_ldap.rb 2007-09-16 22:29:35 +09:00 (rev 124) +++ trunk/lib/active_samba_ldap.rb 2007-09-16 22:50:27 +09:00 (rev 125) @@ -8,7 +8,7 @@ end end -required_active_ldap_version = ">= 0.8.3.1" +required_active_ldap_version = ">= 0.8.4" require_gem_if_need.call("active_ldap", "ruby-activeldap", required_active_ldap_version) Modified: trunk/test/run-test.rb (+1 -1) =================================================================== --- trunk/test/run-test.rb 2007-09-16 22:29:35 +09:00 (rev 124) +++ trunk/test/run-test.rb 2007-09-16 22:50:27 +09:00 (rev 125) @@ -7,7 +7,7 @@ top_dir = File.join(File.dirname(__FILE__), "..") # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap", "lib")) # $LOAD_PATH.unshift(File.join(top_dir, "..", "ldap")) -# $LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib")) +$LOAD_PATH.unshift(File.join(top_dir, "..", "activeldap", "lib")) $LOAD_PATH.unshift(File.join(top_dir, "lib")) $LOAD_PATH.unshift(File.join(top_dir, "test")) Modified: trunk/lib/active_samba_ldap/configuration.rb (+2 -2) =================================================================== --- trunk/lib/active_samba_ldap/configuration.rb 2007-09-16 22:29:35 +09:00 (rev 124) +++ trunk/lib/active_samba_ldap/configuration.rb 2007-09-16 22:50:27 +09:00 (rev 125) @@ -57,10 +57,10 @@ end end - def merge_configuration(config) + def merge_configuration(config, *rest) config = config.symbolize_keys config = (configurations["common"] || {}).symbolize_keys.merge(config) - ValidHash.new.merge(super(Private.new(config).merge)) + ValidHash.new.merge(super(Private.new(config).merge, *rest)) end def required_configuration_variables(*names) Modified: trunk/bin/asl-passwd (+1 -7) =================================================================== --- trunk/bin/asl-passwd 2007-09-16 22:29:35 +09:00 (rev 124) +++ trunk/bin/asl-passwd 2007-09-16 22:50:27 +09:00 (rev 125) @@ -57,14 +57,8 @@ unless Process.uid.zero? prompt = _("Enter your current password: ") old_password = ActiveSambaLdap::Command.read_password(prompt) - - auth_class = Class.new(ActiveSambaLdap::Base) - config = ActiveSambaLdap::Base.configurations["reference"].symbolize_keys begin - auth_class.establish_connection(config.merge(:bind_dn => user.dn, - :password => old_password, - :allow_anonymous => false)) - auth_class.remove_connection + user.bind(old_password) rescue ActiveLdap::AuthenticationError $stderr.puts(_("password doesn't match.")) exit 1 From null at cozmixng.org Sun Sep 16 09:50:31 2007 From: null at cozmixng.o