lib/reap/project/announce.rb in reap-9.3.3 vs lib/reap/project/announce.rb in reap-9.3.4
- old
+ new
@@ -103,22 +103,30 @@
def announce_message(options={})
config = settings['announce'] || {}
options = config.merge(options).to_ostruct
cutoff = options.cutoff || 30
- template = options.template || "{ANNOUNCE,README}{,.txt}"
+ template = options.template || "{ANNOUNCE}{,.txt}"
#config['mail_to'] = nil if keys['mail_to'].empty?
# Build message
# template
template = Dir.glob(options.template.to_s, File::FNM_CASEFOLD).first
- abort "No announcememnt template." unless template
- #
- readme = File.read(template)
- readme = unfold_paragraphs(readme)
+ if template
+ readme = File.read(template)
+ readme = unfold_paragraphs(readme)
+ else
+ readme = ''
+ readme << "= #{metadata.title} v#{metadata.version}\n\n"
+ readme << " #{metadata.homepage}\n\n"
+ readme << "#{metadata.description}\n\n"
+ readme << "Please see the NOTES file.\n\n"
+ readme << "== CHANGES\n\n"
+ readme << "Please see the CHANGES file.\n"
+ end
# changelog
file = Dir.glob('change{s,log}{,.txt}', File::FNM_CASEFOLD)[0]
changelog = file ? File.read(file).strip : ''
#changelog = unfold_paragraphs(changelog)