123456789_123456789_123456789_123456789_123456789_

Class: Shell::AppendFile

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
self, AppendIO, BuiltInCommand, Filter, Enumerable
Inherits: Shell::AppendIO
Defined in: lib/shell/builtin-command.rb

Class Method Summary

Instance Attribute Summary

AppendIO - Inherited

BuiltInCommand - Inherited

Filter - Inherited

Instance Method Summary

Filter - Inherited

#+

Outputs filter1, and then filter2 using Join.new

#<

Inputs from source, which is either a string of a file name or an IO object.

#>

Outputs from source, which is either a string of a file name or an IO object.

#>>

Appends the output to source, which is either a string of a file name or an IO object.

#each

Iterates a block for each line.

#inspect, #to_a, #to_s,
#|

Processes a pipeline.

Constructor Details

.new(sh, to_filename, filter) ⇒ AppendFile

[ GitHub ]

  
# File 'lib/shell/builtin-command.rb', line 103

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

Instance Attribute Details

#input=(filter) (writeonly)

[ GitHub ]

  
# File 'lib/shell/builtin-command.rb', line 109

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