Class: AsciiDataTools::Filter::SortingFilter

Inherits:
BufferingFilter show all
Includes:
ExternalPrograms
Defined in:
lib/ascii-data-tools/filter.rb

Instance Method Summary collapse

Methods included from ExternalPrograms

#diff, #diff_command_for, #edit_differences, #modify_file_mtime_to, #sort

Methods inherited from BufferingFilter

#initialize

Methods inherited from Filter

#<<, #has_records?, #initialize, #read, #write

Constructor Details

This class inherits a constructor from AsciiDataTools::Filter::BufferingFilter

Instance Method Details

#filter_all(tempfile) ⇒ Object



98
99
100
101
102
103
104
105
106
# File 'lib/ascii-data-tools/filter.rb', line 98

def filter_all(tempfile)
  tempfile.close
  
  sorted_tempfile = Tempfile.new("sort")
  sorted_tempfile.close
  
  sort(tempfile, sorted_tempfile)
  sorted_tempfile.open
end