From d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2009 03:56:38 +0000 Subject: * {ext,lib,test}/**/*.rb: removed trailing spaces. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/shell/builtin-command.rb | 10 +++++----- lib/shell/command-processor.rb | 42 ++++++++++++++++++++--------------------- lib/shell/error.rb | 4 ++-- lib/shell/filter.rb | 6 +++--- lib/shell/process-controller.rb | 18 +++++++++--------- lib/shell/system-command.rb | 10 +++++----- lib/shell/version.rb | 2 +- 7 files changed, 46 insertions(+), 46 deletions(-) (limited to 'lib/shell') diff --git a/lib/shell/builtin-command.rb b/lib/shell/builtin-command.rb index b65056de0..e489da4ec 100644 --- a/lib/shell/builtin-command.rb +++ b/lib/shell/builtin-command.rb @@ -1,12 +1,12 @@ # -# shell/builtin-command.rb - +# shell/builtin-command.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "shell/filter" @@ -25,7 +25,7 @@ class Shell def initialize(sh, *opts) super sh end - + def each(rs = nil) # do nothing end @@ -36,7 +36,7 @@ class Shell super sh @strings = strings end - + def each(rs = nil) rs = @shell.record_separator unless rs for str in @strings @@ -70,7 +70,7 @@ class Shell end def each(rs = nil) - if @pattern[0] == ?/ + if @pattern[0] == ?/ @files = Dir[@pattern] else prefix = @shell.pwd+"/" diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 900b31a22..e224d9136 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -1,12 +1,12 @@ # -# shell/command-controller.rb - +# shell/command-controller.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "e2mmap" @@ -39,7 +39,7 @@ class Shell for m in CommandProcessor.instance_methods(false) - NoDelegateMethods add_delegate_command_to_shell(m) end - + def self.method_added(id) add_delegate_command_to_shell(id) end @@ -84,7 +84,7 @@ class Shell # Shell#test # # - - # + # # CommandProcessor#foreach(path, rs) # path: String # rs: String - record separator @@ -168,7 +168,7 @@ class Shell # sh["e", "foo"] # sh[:exists?, "foo"] # sh["exists?", "foo"] - # + # alias top_level_test test def test(command, file1, file2=nil) file1 = expand_path(file1) @@ -211,11 +211,11 @@ class Shell # CommandProcessor#mkdir(*path) # path: String # same as Dir.mkdir() - # + # def mkdir(*path) @shell.check_point notify("mkdir #{path.join(' ')}") - + perm = nil if path.last.kind_of?(Integer) perm = path.pop @@ -236,7 +236,7 @@ class Shell # CommandProcessor#rmdir(*path) # path: String # same as Dir.rmdir() - # + # def rmdir(*path) @shell.check_point notify("rmdir #{path.join(' ')}") @@ -256,7 +256,7 @@ class Shell # example: # print sh.system("ls", "-l") # sh.system("ls", "-l") | sh.head > STDOUT - # + # def system(command, *opts) if opts.empty? if command =~ /\*|\?|\{|\}|\[|\]|<|>|\(|\)|~|&|\||\\|\$|;|'|`|"|\n/ @@ -338,7 +338,7 @@ class Shell def notify(*opts, &block) Shell.notify(*opts) {|mes| yield mes if iterator? - + mes.gsub!("%pwd", "#{@cwd}") mes.gsub!("%cwd", "#{@cwd}") } @@ -383,10 +383,10 @@ class Shell SystemCommand.new(@shell, '#{path}', *opts) end]), nil, __FILE__, __LINE__ - 1) rescue SyntaxError - Shell.notify "warn: Can't define #{command} path: #{path}." + Shell.notify "warn: Can't define #{command} path: #{path}." end Shell.notify "Define #{command} path: #{path}.", Shell.debug? - Shell.notify("Definition of #{command}: ", d, + Shell.notify("Definition of #{command}: ", d, Shell.debug.kind_of?(Integer) && Shell.debug > 1) end @@ -418,7 +418,7 @@ class Shell @shell.__send__(:#{command}, *(CommandProcessor.alias_map[:#{ali}].call *opts)) end]), nil, __FILE__, __LINE__ - 1) - + else args = opts.collect{|opt| '"' + opt + '"'}.join(",") eval((d = %Q[def #{ali}(*opts) @@ -426,22 +426,22 @@ class Shell end]), nil, __FILE__, __LINE__ - 1) end rescue SyntaxError - Shell.notify "warn: Can't alias #{ali} command: #{command}." + Shell.notify "warn: Can't alias #{ali} command: #{command}." Shell.notify("Definition of #{ali}: ", d) raise end Shell.notify "Define #{ali} command: #{command}.", Shell.debug? - Shell.notify("Definition of #{ali}: ", d, + Shell.notify("Definition of #{ali}: ", d, Shell.debug.kind_of?(Integer) && Shell.debug > 1) self end - + def self.unalias_command(ali) ali = ali.id2name if ali.kind_of?(Symbol) @alias_map.delete ali.intern undef_system_command(ali) end - + # # CommandProcessor.def_builtin_commands(delegation_class, command_specs) # delegation_class: Class or Module @@ -472,7 +472,7 @@ class Shell #{delegation_class}.#{meth}(#{call_arg_str}) end] Shell.notify "Define #{meth}(#{arg_str})", Shell.debug? - Shell.notify("Definition of #{meth}: ", d, + Shell.notify("Definition of #{meth}: ", d, Shell.debug.kind_of?(Integer) && Shell.debug > 1) eval d end @@ -513,7 +513,7 @@ class Shell #---------------------------------------------------------------------- # - # class initializing methods - + # class initializing methods - # #---------------------------------------------------------------------- def self.add_delegate_command_to_shell(id) @@ -561,7 +561,7 @@ class Shell normal_delegation_file_methods = [ ["atime", ["FILENAME"]], ["basename", ["fn", "*opts"]], - ["chmod", ["mode", "*FILENAMES"]], + ["chmod", ["mode", "*FILENAMES"]], ["chown", ["owner", "group", "*FILENAME"]], ["ctime", ["FILENAMES"]], ["delete", ["*FILENAMES"]], @@ -584,7 +584,7 @@ class Shell alias_method :rm, :delete # method related FileTest - def_builtin_commands(FileTest, + def_builtin_commands(FileTest, FileTest.singleton_methods(false).collect{|m| [m, ["FILENAME"]]}) end diff --git a/lib/shell/error.rb b/lib/shell/error.rb index 8bb96c22d..dbb788a6f 100644 --- a/lib/shell/error.rb +++ b/lib/shell/error.rb @@ -1,12 +1,12 @@ # -# shell/error.rb - +# shell/error.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "e2mmap" diff --git a/lib/shell/filter.rb b/lib/shell/filter.rb index 3bb683db2..3f88d0f5d 100644 --- a/lib/shell/filter.rb +++ b/lib/shell/filter.rb @@ -1,12 +1,12 @@ # -# shell/filter.rb - +# shell/filter.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # class Shell @@ -28,7 +28,7 @@ class Shell def input=(filter) @input = filter end - + def each(rs = nil) rs = @shell.record_separator unless rs if @input diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb index f2bf1d44c..829ff7900 100644 --- a/lib/shell/process-controller.rb +++ b/lib/shell/process-controller.rb @@ -1,12 +1,12 @@ # -# shell/process-controller.rb - +# shell/process-controller.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # require "forwardable" @@ -26,7 +26,7 @@ class Shell class<