lib/garcon/core_ext/string.rb
# Search a text file for a matching string
#
# @return [Boolean]
#   True if the file is present and a match was found, otherwise returns
#   false if file does not exist and/or does not contain a match
#
# @api public
Search a text file for a matching string
Search a text file for a matching string
def contains?(str)
    return false unless ::File.exist?(self)
    ::File.open(self, &:readlines).collect { |l| return true if l.match(str) }
    false
  end
def contains? ( str ) return false unless :: File . exist? ( self ) :: File . open ( self , & :readlines ) . collect { | l | return true if l . match ( str ) } false end
Search a text file for a matching string
Search a text file for a matching string
True if the file is present and a match was found, otherwise returns false if file does not exist and/or does not contain a match
True if the file is present and a match was found otherwise returns false if file does not exist and / or does not contain a match
Boolean
str
<not_specific>
api
None