From 9ff1e787f915539b1980654e3d3d2013ff5c81d2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 7 Jul 2008 07:38:25 +0000 Subject: wrong commit; sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/lib/shell/filter.rb | 110 ----------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 ruby_1_8_6/lib/shell/filter.rb (limited to 'ruby_1_8_6/lib/shell/filter.rb') diff --git a/ruby_1_8_6/lib/shell/filter.rb b/ruby_1_8_6/lib/shell/filter.rb deleted file mode 100644 index 27c5534695..0000000000 --- a/ruby_1_8_6/lib/shell/filter.rb +++ /dev/null @@ -1,110 +0,0 @@ -# -# shell/filter.rb - -# $Release Version: 0.6.0 $ -# $Revision$ -# $Date$ -# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) -# -# -- -# -# -# - -class Shell - # - # Filter - # A method to require - # each() - # - class Filter - include Enumerable - - def initialize(sh) - @shell = sh # parent shell - @input = nil # input filter - end - - attr_reader :input - - def input=(filter) - @input = filter - end - - def each(rs = nil) - rs = @shell.record_separator unless rs - if @input - @input.each(rs){|l| yield l} - end - end - - def < (src) - case src - when String - cat = Cat.new(@shell, src) - cat | self - when IO - self.input = src - self - else - 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 - when IO - each(){|l| to << l} - else - Shell.Fail Error::CantApplyMethod, ">", to.class - end - self - end - - def >> (to) - begin - Shell.cd(@shell.pwd).append(to, self) - rescue CantApplyMethod - Shell.Fail Error::CantApplyMethod, ">>", to.class - end - end - - def | (filter) - filter.input = self - if active? - @shell.process_controller.start_job filter - end - filter - end - - def + (filter) - Join.new(@shell, self, filter) - end - - def to_a - ary = [] - each(){|l| ary.push l} - ary - end - - def to_s - str = "" - each(){|l| str.concat l} - str - end - - def inspect - if @shell.debug.kind_of?(Integer) && @shell.debug > 2 - super - else - to_s - end - end - end -end -- cgit v1.2.3