Updated or added timestamp to obsolete and fixme messages.
Fixed ecf file exclusion for .svn and .git . Cosmetic changed.
This commit is contained in:
@@ -55,7 +55,7 @@ feature -- Access
|
||||
|
||||
body: like content
|
||||
obsolete
|
||||
"Use `content' [June/2015]"
|
||||
"Use `content'. [2017-05-31]"
|
||||
do
|
||||
Result := body
|
||||
end
|
||||
@@ -69,6 +69,19 @@ feature -- Status report
|
||||
across to_addresses as ic all is_valid_address (ic.item) end
|
||||
end
|
||||
|
||||
has_header (a_header_name: READABLE_STRING_8): BOOLEAN
|
||||
-- Has additional header `a_header_name'?
|
||||
-- Warning: it checks only `additional_header_lines'!
|
||||
local
|
||||
h_colon: STRING
|
||||
do
|
||||
if attached additional_header_lines as lst then
|
||||
create h_colon.make_from_string (a_header_name)
|
||||
h_colon.append_character (':')
|
||||
Result := across lst as ic some ic.item.starts_with (h_colon) end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Change
|
||||
|
||||
set_date (d: like date)
|
||||
@@ -158,21 +171,6 @@ feature -- Header manipulation
|
||||
lst.force (a_line)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
has_header (a_header_name: READABLE_STRING_8): BOOLEAN
|
||||
-- Has additional header `a_header_name'?
|
||||
-- Warning: it checks only `additional_header_lines'!
|
||||
local
|
||||
h_colon: STRING
|
||||
do
|
||||
if attached additional_header_lines as lst then
|
||||
create h_colon.make_from_string (a_header_name)
|
||||
h_colon.append_character (':')
|
||||
Result := across lst as ic some ic.item.starts_with (h_colon) end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Reset
|
||||
|
||||
reset
|
||||
@@ -209,8 +207,6 @@ feature -- Conversion
|
||||
end
|
||||
|
||||
header: STRING_8
|
||||
local
|
||||
hdate: HTTP_DATE
|
||||
do
|
||||
create Result.make (20)
|
||||
if attached reply_to_address as l_reply_to then
|
||||
@@ -259,8 +255,7 @@ feature -- Conversion
|
||||
Result.append (subject)
|
||||
Result.append_character ('%N')
|
||||
Result.append ("Date: ")
|
||||
create hdate.make_from_date_time (date)
|
||||
hdate.append_to_rfc1123_string (Result)
|
||||
;(create {HTTP_DATE}.make_from_date_time (date)).append_to_rfc1123_string (Result)
|
||||
Result.append_character ('%N')
|
||||
if attached additional_header_lines as l_lines and then
|
||||
not l_lines.is_empty
|
||||
@@ -285,11 +280,8 @@ feature -- Helpers
|
||||
Result := add.has ('@')
|
||||
end
|
||||
|
||||
invariant
|
||||
-- invariant_clause: True
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<target name="notification_email">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
<exclude>/\.git$</exclude>
|
||||
<exclude>/\.svn$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true">
|
||||
|
||||
@@ -43,11 +43,8 @@ feature {NONE} -- Initialization
|
||||
feature -- Status
|
||||
|
||||
is_available: BOOLEAN
|
||||
local
|
||||
f: RAW_FILE
|
||||
do
|
||||
create f.make_with_path (executable_path)
|
||||
Result := f.exists
|
||||
Result := (create {RAW_FILE}.make_with_path (executable_path)).exists
|
||||
end
|
||||
|
||||
feature -- Change
|
||||
@@ -108,7 +105,7 @@ feature -- Basic operation
|
||||
if attached arguments as l_args then
|
||||
args := l_args.twin
|
||||
else
|
||||
if attached {RAW_FILE} new_temporary_file (generator) as f then
|
||||
if attached new_temporary_file (generator) as f then
|
||||
f.create_read_write
|
||||
f.put_string (a_email.message)
|
||||
f.close
|
||||
@@ -196,10 +193,8 @@ feature {NONE} -- Implementation
|
||||
result_creatable: Result.is_creatable
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
note
|
||||
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -4,9 +4,8 @@ note
|
||||
|
||||
Note: it is based on EiffelNet {SMTP_PROTOCOL} implementation, and may not be complete.
|
||||
]"
|
||||
author: "$Author: jfiat $"
|
||||
date: "$Date: 2015-06-30 11:07:17 +0200 (mar., 30 juin 2015) $"
|
||||
revision: "$Revision: 97586 $"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
NOTIFICATION_SMTP_MAILER
|
||||
@@ -57,15 +56,12 @@ feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
-- Initialize service.
|
||||
local
|
||||
l_address_factory: INET_ADDRESS_FACTORY
|
||||
do
|
||||
if attached username as u then
|
||||
create smtp_protocol.make (smtp_host, u)
|
||||
else
|
||||
-- Get local host name needed in creation of SMTP_PROTOCOL.
|
||||
create l_address_factory
|
||||
create smtp_protocol.make (smtp_host, l_address_factory.create_localhost.host_name)
|
||||
create smtp_protocol.make (smtp_host, (create {INET_ADDRESS_FACTORY}).create_localhost.host_name)
|
||||
end
|
||||
if smtp_port > 0 then
|
||||
smtp_protocol.set_default_port (smtp_port)
|
||||
@@ -98,9 +94,7 @@ feature -- Basic operation
|
||||
local
|
||||
l_email: EMAIL
|
||||
h: STRING
|
||||
k,v: STRING
|
||||
i: INTEGER
|
||||
hdate: HTTP_DATE
|
||||
do
|
||||
create l_email.make_with_entry (a_email.from_address, addresses_to_header_line_value (a_email.to_addresses))
|
||||
if attached a_email.reply_to_address as l_reply_to then
|
||||
@@ -117,8 +111,7 @@ feature -- Basic operation
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
|
||||
|
||||
create h.make_empty
|
||||
create hdate.make_from_date_time (a_email.date)
|
||||
hdate.append_to_rfc1123_string (h)
|
||||
;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
|
||||
l_email.add_header_entry ("Date", h)
|
||||
|
||||
if attached a_email.additional_header_lines as lst then
|
||||
@@ -128,9 +121,7 @@ feature -- Basic operation
|
||||
h := ic.item
|
||||
i := h.index_of (':', 1)
|
||||
if i > 0 then
|
||||
k := h.head (i - 1)
|
||||
v := h.substring (i + 1, h.count)
|
||||
l_email.add_header_entry (k, v)
|
||||
l_email.add_header_entry (h.head (i - 1), h.substring (i + 1, h.count))
|
||||
else
|
||||
check is_header_line: False end
|
||||
end
|
||||
@@ -181,7 +172,7 @@ feature {NONE} -- Implementation
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
note
|
||||
description: "Store emails in specific folder."
|
||||
date: "$Date: 2017-03-08 10:34:57 +0100 (mer., 08 mars 2017) $"
|
||||
revision: "$Revision: 99935 $"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
NOTIFICATION_EMAIL_DIRECTORY_STORAGE
|
||||
@@ -41,7 +41,7 @@ feature -- Storage
|
||||
-- Store `a_email'.
|
||||
local
|
||||
retried: BOOLEAN
|
||||
f,w: RAW_FILE
|
||||
w: RAW_FILE
|
||||
dt: DATE_TIME
|
||||
p: PATH
|
||||
fn: STRING
|
||||
@@ -72,8 +72,7 @@ feature -- Storage
|
||||
p := p.extended (fn)
|
||||
|
||||
from
|
||||
create f.make_with_path (p)
|
||||
w := new_file_opened_for_writing (f)
|
||||
w := new_file_opened_for_writing (create {RAW_FILE}.make_with_path (p))
|
||||
until
|
||||
w /= Void or i > 100
|
||||
loop
|
||||
@@ -113,14 +112,15 @@ feature -- Storage
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
if not retried then
|
||||
if not f.exists then
|
||||
f.open_write
|
||||
if f.is_open_write then
|
||||
Result := f
|
||||
elseif not f.is_closed then
|
||||
f.close
|
||||
end
|
||||
if
|
||||
not retried and then
|
||||
not f.exists
|
||||
then
|
||||
f.open_write
|
||||
if f.is_open_write then
|
||||
Result := f
|
||||
elseif not f.is_closed then
|
||||
f.close
|
||||
end
|
||||
end
|
||||
ensure
|
||||
|
||||
Reference in New Issue
Block a user