-
-
Save cdlm/f5d046591232b2ab0e73 to your computer and use it in GitHub Desktop.
Sending a bi-monthly email to gather contributor activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# This is intended to be run 1st and 3rd monday of each month: | |
# | |
# sample crontab entry: | |
# 0 7 1-7,15-21 * * [ "$(date '+%a')" == 'Mon' ] && { pharo-whatsup.rb | mail -t; } | |
require "date" | |
def monday_of_week day | |
day + 1 - day.cwday | |
end | |
start_date = monday_of_week Date.today | |
end_mday = if start_date.mday.between? 1,14 | |
start_date.mday + 13 | |
else | |
-1 # last day of the month | |
end | |
end_date = Date.civil(start_date.year, start_date.month, end_mday) | |
# find the monday of the following week | |
next_date = monday_of_week(end_date + 7) | |
puts <<EOF | |
From: seaside@rmod.lille.inria.fr | |
To: pharo-project@lists.gforge.inria.fr | |
Subject: WhatsUp from: #{start_date} until: #{end_date} | |
Hi! We're sending this automatic email twice a month, to give the community an opportunity to easily know what's happening and to coordinate efforts. Just answer informally, and feel free to spawn discussions thereafter! | |
### Here's what I've been up to since the last WhatsUp: | |
- $HEROIC_ACHIEVEMENTS_OR_DISMAL_FAILURES_OR_SIMPLE_BORING_NECESSARY_TASKS | |
### What's next, until #{end_date} (*): | |
- $NEXT_STEPS_TOWARDS_WORLD_DOMINATION | |
(*) we'll be expecting results by then ;) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment