diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-18 21:19:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-18 21:19:18 +0000 |
commit | 7bbf2f308580f468802cd7d32c94fce1b9f1779e () | |
tree | 0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/shell/builtin-command.rb | |
parent | 34276148c4450faa77bb298cfbe005f7c263f802 (diff) |
* lib: Convert tabs to spaces for ruby files per
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style by Steve Klabnik [Ruby 1.9 - Bug #4730] by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/shell/builtin-command.rb | 62 |
1 files changed, 31 insertions, 31 deletions
@@ -1,8 +1,8 @@ # # shell/builtin-command.rb - -# $Release Version: 0.7 $ -# $Revision$ -# by Keiju ISHITSUKA([email protected]) # # -- # @@ -40,7 +40,7 @@ class Shell def each(rs = nil) rs = @shell.record_separator unless rs for str in @strings - yield str + rs end end end @@ -53,11 +53,11 @@ class Shell def each(rs = nil) if @cat_files.empty? - super else - for src in @cat_files - @shell.foreach(src, rs){|l| yield l} - end end end end @@ -71,31 +71,31 @@ class Shell def each(rs = nil) if @pattern[0] == ?/ - @files = Dir[@pattern] else - prefix = @shell.pwd+"/" - @files = Dir[prefix+@pattern].collect{|p| p.sub(prefix, "")} end rs = @shell.record_separator unless rs for f in @files - yield f+rs end end end -# class Sort < Cat -# def initialize(sh, *filenames) -# super -# end -# -# def each(rs = nil) -# ary = [] -# super{|l| ary.push l} -# for l in ary.sort! -# yield l -# end -# end -# end class AppendIO < BuiltInCommand def initialize(sh, io, filter) @@ -107,7 +107,7 @@ class Shell def input=(filter) @input.input=filter for l in @input - @io << l end end @@ -122,9 +122,9 @@ class Shell def input=(filter) begin - super ensure - @io.close end end end @@ -138,9 +138,9 @@ class Shell def each(rs = nil) to = @shell.open(@to_filename, "w") begin - super{|l| to << l; yield l} ensure - to.close end end end @@ -153,7 +153,7 @@ class Shell def each(rs = nil) while job = @jobs.shift - job.each{|l| yield l} end end end |