diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-17 10:19:45 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-17 10:19:45 +0000 |
commit | 491c26f3ef3fdcdc957548fdb2f773e2af6b252f (patch) | |
tree | 6ee7cea921d64f37739eafe578f2c3daf3927fe9 /lib | |
parent | 4578a096d1b12ad7c4d988ceaee461c4a7850a89 (diff) |
* lib/shell.rb, lib/shell/process-controller.rb,
lib/shell/command-processor.rb: translate Japanese comments into
English.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/shell.rb | 11 | ||||
-rw-r--r-- | lib/shell/command-processor.rb | 27 | ||||
-rw-r--r-- | lib/shell/process-controller.rb | 16 |
3 files changed, 24 insertions, 30 deletions
diff --git a/lib/shell.rb b/lib/shell.rb index 5babc4175b..1d28834213 100644 --- a/lib/shell.rb +++ b/lib/shell.rb @@ -123,10 +123,10 @@ class Shell end end - # �ۤȤ�ɤ�Shell Command �� CommandProcessor �ˤ����������. + # Most Shell commands are defined via CommandProcessor # - # Dir��Ϣ��å� + # Dir related methods # # Shell#cwd/dir/getwd/pwd # Shell#chdir/cd @@ -143,7 +143,8 @@ class Shell attr :dir_stack alias dirs dir_stack - # ���ƥ졼���Ȥ��ƸƤФ��Ȱ��Ū��cd���뤳�Ȥˤʤ�. + # If called as iterator, it restores the current directory when the + # block ends. def chdir(path = nil) if iterator? cwd_old = @cwd @@ -202,7 +203,7 @@ class Shell # - # process ���� + # process management # def jobs @process_controller.jobs @@ -213,7 +214,7 @@ class Shell end # - # command ��� + # command definitions # def Shell.def_system_command(command, path = command) CommandProcessor.def_system_command(command, path) diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 38e38151fa..fa253b3705 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -65,14 +65,14 @@ class Shell # CommandProcessor#expand_path(path) # path: String # return: String - # pwd����ߤ����Хѥ����֤� + # returns the absolute path for <path> # def expand_path(path) @shell.expand_path(path) end # - # File��Ϣ���ޥ�� + # File related commands # Shell#foreach # Shell#open # Shell#unlink @@ -87,7 +87,7 @@ class Shell # Same as: # File#foreach (when path is file) # Dir#foreach (when path is directory) - # path��pwd��������Хѥ��ˤʤ� + # path is relative to pwd # def foreach(path = nil, *rs) path = "." unless path @@ -108,7 +108,7 @@ class Shell # Same as: # File#open (when path is file) # Dir#open (when path is directory) - # mode��path���ե�����λ�����ͭ�� + # mode has an effect only when path is a file # def open(path, mode) path = expand_path(path) @@ -181,7 +181,7 @@ class Shell alias [] test # - # Dir��Ϣ��å� + # Dir related methods # # Shell#mkdir # Shell#rmdir @@ -454,18 +454,11 @@ class Shell # # CommandProcessor.install_system_commands(pre) # pre: String - command name prefix - # define CommandProcessor.command() from all command of - # default_system_path. If a method exists, and names of it and - # the target command are the same, the method is not defined. - # Default action prefix "sys_" to the method name. The character - # which is not forgiven as a method name (when the first char is - # alphabet or char is alpha-numeric) converts into ``_''. A - # definition error is ignored. - # (Meaning same in Japanese: default_system_path��ˤΤ륳�ޥ�ɤ��� - # ������. ���Ǥ�Ʊ̾�Υ�åɤ�¸�ߤ������, �����Ԥʤ�ʤ�. �� - # �ե���ȤǤ�, ���ƤΥ�åɤˤ���Ƭ��"sys_"��Ĥ���. ��å�̾ - # �Ȥ��Ƶ�����ʤ�����饯��(�ѿ����ʳ��ȥ�å�̾����Ƭ�����ͤ� - # �ʤ���)��, ����Ū��``_''���Ѵ�����. ������顼��̵�뤹��.) + # defines every command which belongs in default_system_path via + # CommandProcessor.command(). It doesn't define already defined + # methods twice. By default, "pre_" is prefixes to each method + # name. Characters that may not be used in a method name are + # all converted to '_'. Definition errors are just ignored. # def self.install_system_commands(pre = "sys_") defined_meth = {} diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb index 5cbbe0c500..26fb1d9f08 100644 --- a/lib/shell/process-controller.rb +++ b/lib/shell/process-controller.rb @@ -102,7 +102,7 @@ class Shell end end - # job�Υ������塼����ɲ� + # schedule a command def add_schedule(command) @jobs_sync.synchronize(:EX) do ProcessController.activate(self) @@ -114,7 +114,7 @@ class Shell end end - # job �Ϥ��� + # start a job def start_job(command = nil) @jobs_sync.synchronize(:EX) do if command @@ -127,7 +127,7 @@ class Shell @active_jobs.push command command.start - # ����job��input�Ȥ���job�Ⳬ�Ϥ��� + # start all jobs that input from the job for job in @waiting_jobs start_job(job) if job.input == command end @@ -146,7 +146,7 @@ class Shell end end - # job�ν�λ + # terminate a job def terminate_job(command) @jobs_sync.synchronize(:EX) do @active_jobs.delete command @@ -157,7 +157,7 @@ class Shell end end - # job�ζ�����λ + # kill a job def kill_job(sig, command) @jobs_sync.synchronize(:SH) do if @waiting_jobs.delete command @@ -177,7 +177,7 @@ class Shell end end - # ���٤Ƥ�job�μ¹Խ�λ�Ԥ� + # wait for all jobs to terminate def wait_all_jobs_execution @job_monitor.synchronize do begin @@ -190,7 +190,7 @@ class Shell end end - # ��ñ��fork + # simple fork def sfork(command, &block) pipe_me_in, pipe_peer_out = IO.pipe pipe_peer_in, pipe_me_out = IO.pipe @@ -237,7 +237,7 @@ class Shell command.notify "warn: job(%id) was done already waitipd." _pid = true ensure - # �ץ�������λ���˥��ޥ�ɼ¹Ԥ������ޤ��Ԥ����뤿��. + # when the process ends, wait until the command termintes if _pid else command.notify("notice: Process finishing...", |