Class: Shell::AppendIO

Inherits:
BuiltInCommand show all
Defined in:
lib/shell/builtin-command.rb

Overview

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

Direct Known Subclasses

AppendFile

Instance Attribute Summary

Attributes inherited from Filter

#input

Instance Method Summary collapse

Methods inherited from BuiltInCommand

#active?, #wait?

Methods inherited from Filter

#+, #<, #>, #>>, #each, #inspect, #to_a, #to_s, #|

Constructor Details

#initialize(sh, io, filter) ⇒ AppendIO

Returns a new instance of AppendIO.



95
96
97
98
99
# File 'lib/shell/builtin-command.rb', line 95

def initialize(sh, io, filter)
  super sh
  @input = filter
  @io = io
end

Instance Method Details

#input=(filter) ⇒ Object



101
102
103
104
105
106
# File 'lib/shell/builtin-command.rb', line 101

def input=(filter)
  @input.input=filter
  for l in @input
	@io << l
  end
end