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 (patch) | |
tree | 0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/shell/filter.rb | |
parent | 34276148c4450faa77bb298cfbe005f7c263f802 (diff) |
* lib: Convert tabs to spaces for ruby files per
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
Patch by Steve Klabnik [Ruby 1.9 - Bug #4730]
Patch 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
Diffstat (limited to 'lib/shell/filter.rb')
-rw-r--r-- | lib/shell/filter.rb | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/shell/filter.rb b/lib/shell/filter.rb index 3f88d0f5d2..d07cc3dd07 100644 --- a/lib/shell/filter.rb +++ b/lib/shell/filter.rb @@ -1,8 +1,8 @@ # # shell/filter.rb - -# $Release Version: 0.7 $ -# $Revision$ -# by Keiju ISHITSUKA(keiju@ruby-lang.org) +# $Release Version: 0.7 $ +# $Revision$ +# by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # @@ -19,8 +19,8 @@ class Shell include Enumerable def initialize(sh) - @shell = sh # parent shell - @input = nil # input filter + @shell = sh # parent shell + @input = nil # input filter end attr_reader :input @@ -32,52 +32,52 @@ class Shell def each(rs = nil) rs = @shell.record_separator unless rs if @input - @input.each(rs){|l| yield l} + @input.each(rs){|l| yield l} end end def < (src) case src when String - cat = Cat.new(@shell, src) - cat | self + cat = Cat.new(@shell, src) + cat | self when IO - self.input = src - self + self.input = src + self else - Shell.Fail Error::CantApplyMethod, "<", to.class + Shell.Fail Error::CantApplyMethod, "<", to.class end end def > (to) case to when String - dst = @shell.open(to, "w") - begin - each(){|l| dst << l} - ensure - dst.close - end + dst = @shell.open(to, "w") + begin + each(){|l| dst << l} + ensure + dst.close + end when IO - each(){|l| to << l} + each(){|l| to << l} else - Shell.Fail Error::CantApplyMethod, ">", to.class + Shell.Fail Error::CantApplyMethod, ">", to.class end self end def >> (to) begin - Shell.cd(@shell.pwd).append(to, self) + Shell.cd(@shell.pwd).append(to, self) rescue CantApplyMethod - Shell.Fail Error::CantApplyMethod, ">>", to.class + Shell.Fail Error::CantApplyMethod, ">>", to.class end end def | (filter) filter.input = self if active? - @shell.process_controller.start_job filter + @shell.process_controller.start_job filter end filter end @@ -100,9 +100,9 @@ class Shell def inspect if @shell.debug.kind_of?(Integer) && @shell.debug > 2 - super + super else - to_s + to_s end end end |