def setup
@address = section['to']
@from = section['from'].to_s
@server = section['server'].to_s.strip
@port = section['port'] || 25
@domain = section['domain'].to_s.strip
@account = section['account'].to_s
@authtype = section['authtype'].to_sym
@tls = section['tls'] ? true : false
@title = master['title']
@version = master['version']
@summary = master['summary']
@subject = "[ANN] #{@title}, v#{@version}"
announce = %Q{
|
|A N N O U N C I N G
|
|#{@title}, v#{@version}
|
|#{@summary}
|
}.margin.center_lines(66)
abstract = ''
desc = description
if desc
abstract << "\n\n"
abstract << "ABSTRACT: #{desc}".word_wrap(72)
abstract << "\n"
end
info = ''
info_arr = section['info']
unless info_arr.empty?
info << "\n"
info << "For More Information".center(67)
info << "\n"
info_arr.each{ |mi| info << "#{mi}".center(67) }
info << "\n\n"
end
slogan = ''
if section['slogan']
slogan << "\n\n"
slogan << section['slogan'].center(67)
slogan << "\n\n"
end
memo = ''
if section['memo']
memo = ''
memo << "\n" << ('-' * 72) << "\n"
memo << "(Memo)\n\n"
memo << section['memo'].fold.word_wrap(72)
end
msg = ''
msg_file = section['file']
if msg_file and File.file?( msg_file )
msg << "\n" << ("-" * 72) << "\n"
msg << "(from #{msg_file})\n\n"
mg = ''
File.open( msg_file ) { |f| mg << f.gets(nil) }
msg << mg.fold.word_wrap(72)
end
stamp = ''
stamp << "\n" << ("-" * 72) << "\n"
stamp << %Q{
|Generated by Reap, a dedicated Ruby Packaging Assistant.
|Do you Ruby? (http://www.ruby-lang.org)
}.margin
stamp << "\n\n"
@message = ''
@message << announce
@message << abstract
@message << info
@message << slogan
@message << memo
@message << msg
@message << stamp
end