module Amnesie::Persist
Public Class Methods
grep?(file, regex)
click to toggle source
# File lib/amnesie/persist.rb, line 3 def self.grep?(file, regex) is_found = false return is_found if ! File.exist? file File.open(file) do |f| f.each do |line| is_found = true if line.match(regex) end end is_found end