I am relatively new to Ruby, and am attempting to strip email signatures from emails sent into my Rails application, based on this answer: Strip signatures and replies from emails. While I know there are a number of ways to strip strings and match characters, etc., for some reason these are not matching new lines in the email body.
For instance, to try and pinpoint a signature beginning with '-- \n', I have:
email_body.include? '-- \n'
Which evaluates to false even though the email contains this in the signature. Furthermore, when I try to truncate the string, based on: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate:
truncate(email_body, :separator => '--')
I get 'undefined method truncate'. It seems like something along these lines should be working, however is not so far.
What is the proper way to remove all text after the signature delimiter in the string? Any help is appreciated.