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.



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

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



123
124
125
126
127
128
129
# File 'lib/shell/builtin-command.rb', line 123

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