Module: Readlines

Defined in:
lib/readlines/readlines/error.rb,
lib/readlines/read.rb,
lib/readlines/readlines/file.rb,
lib/readlines/readlines/info.rb,
lib/readlines/readlines/sort.rb,
lib/readlines/readlines/check.rb,
lib/readlines/readlines/count.rb,
lib/readlines/readlines/merge.rb,
lib/readlines/readlines/split.rb,
lib/readlines/readlines/delete.rb,
lib/readlines/readlines/filter.rb,
lib/readlines/readlines/search.rb,
lib/readlines/readlines/content.rb,
lib/readlines/readlines/convert.rb,
lib/readlines/readlines/pattern.rb,
lib/readlines/readlines/replace.rb,
lib/readlines/readlines/version.rb

Overview

lib/readlines/readlines/version.rb

Defined Under Namespace

Modules: Check, Content, Convert, Count, Delete, Error, File, Filter, Info, Merge, Pattern, Replace, Search, Sort, Split, Version Classes: ReadDuc

Instance Method Summary collapse

Instance Method Details

#filter(file_path, value, query, operation, replacement = nil) ⇒ Object



287
288
289
290
291
292
293
294
# File 'lib/readlines/read.rb', line 287

def filter(file_path, value, query, operation, replacement = nil)
  processed_lines = []
  File.foreach(file_path) do |line|
    result = filter(line, value, query, operation, replacement)
    processed_lines << result if result # Only add if result is not nil (for delete operation)
  end
  processed_lines
end