File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1414DB_NAME_REGEX = /\S +_staging/
1515KEYWORDS_REGEX = /sorry|help|wrong/i
1616
17+ def create_reply ( subject )
18+ gmail . compose do
19+ to kumars_email
20+ subject "RE: #{ subject } "
21+ body "No problem. I've fixed it. \n \n Please be careful next time."
22+ end
23+ end
24+
1725gmail . inbox . find ( :unread , from : kumars_email ) . each do |email |
18- if email . body [ KEYWORDS_REGEX ] && ( db_name = email . body [ DB_NAME_REGEX ] )
26+ if email . body . raw_source [ KEYWORDS_REGEX ] && ( db_name = email . body . raw_source [ DB_NAME_REGEX ] )
1927 backup_file = "/home/backups/databases/#{ db_name } -" + ( Date . today - 1 ) . strftime ( '%Y%m%d' ) + '.gz'
2028 abort 'ERROR: Backup file not found' unless File . exist? ( backup_file )
2129
2937 gmail . deliver ( reply )
3038 end
3139end
32-
33- def create_reply ( subject )
34- gmail . compose do
35- to kumars_email
36- subject "RE: #{ subject } "
37- body "No problem. I've fixed it. \n \n Please be careful next time."
38- end
39- end
You can’t perform that action at this time.
0 commit comments