mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-11-12 04:05:01 -05:00
Some syntax bits
This commit is contained in:
parent
d74b700216
commit
a2f9808c75
@ -185,7 +185,7 @@ module_function
|
||||
rescue RuntimeError
|
||||
if $!.to_s =~ /\bno acceptor\b/
|
||||
puts "~~> ERROR: Something's using port #{port}. Are you already running MailCatcher?"
|
||||
exit -1
|
||||
exit(-1)
|
||||
else
|
||||
raise
|
||||
end
|
||||
|
@ -43,7 +43,7 @@ module_function
|
||||
@@add_message_query ||= db.prepare("INSERT INTO message (sender, recipients, subject, source, type, size, created_at) VALUES (?, ?, ?, ?, ?, ?, datetime('now'))")
|
||||
|
||||
mail = Mail.new(message[:source])
|
||||
result = @@add_message_query.execute(message[:sender], message[:recipients].to_json, mail.subject, message[:source], mail.mime_type || 'text/plain', message[:source].length)
|
||||
@@add_message_query.execute(message[:sender], message[:recipients].to_json, mail.subject, message[:source], mail.mime_type || 'text/plain', message[:source].length)
|
||||
message_id = db.last_insert_row_id
|
||||
parts = mail.all_parts
|
||||
parts = [mail] if parts.empty?
|
||||
@ -139,7 +139,7 @@ module_function
|
||||
def message_part_cid(message_id, cid)
|
||||
@@message_part_cid_query ||= db.prepare 'SELECT * FROM message_part WHERE message_id = ?'
|
||||
@@message_part_cid_query.execute(message_id).map do |row|
|
||||
part = Hash[row.fields.zip(row)]
|
||||
Hash[row.fields.zip(row)]
|
||||
end.find do |part|
|
||||
part["cid"] == cid
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user