Class: Shell::AppendFile

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

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, to_filename, filter) ⇒ AppendFile

Returns a new instance of AppendFile.



111
112
113
114
115
# File 'lib/shell/builtin-command.rb', line 111

def initialize(sh, to_filename, filter)
  @file_name = to_filename
  io = sh.open(to_filename, "a")
  super(sh, io, filter)
end

Instance Method Details

#input=(filter) ⇒ Object



117
118
119
120
121
122
123
# File 'lib/shell/builtin-command.rb', line 117

def input=(filter)
  begin
	super
  ensure
	@io.close
  end
end