ticket-tracking

Mail gem - how to clean up the body string

回眸只為那壹抹淺笑 提交于 2019-12-04 09:29:32
问题 I'm trying to read an email using ruby mail gem. But mail.body.decoded returns me not just the body message. How can I clean up this body message and remove unwanted text like: -20cf30433c9a437cc304939017ef\nContent-Type: text/plain; charset=ISO-8859-1\nContent- message = $stdin.read mail = Mail.read_from_string(message) puts mail.body.decoded --20cf30433c9a437cc304939017ef\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: quoted-printable\n\n REAL BODY TEXT \\n\n-

Start a git commit message with a hashmark (#)

自闭症网瘾萝莉.ら 提交于 2019-11-26 00:57:26
问题 Git treats lines starting with # as comment lines when committing. this is very annoying when working with a ticket tracking system, and trying to write the ticket number at the beginning of the line, e.g. #123 salt hashed passwords git will simply remove the line from the commit message. is there any way to escape the hash? i tried \\ and ! , but nothing works. whitespaces before # are preserved, so they aren\'t a working solution to the problem either. 回答1: This behaviour is part of git