module MonthlyQuotaPace
Overview
Check a monthly quota you set against the daily sends you list. Everything is arithmetic on your numbers: the tool reads no clock (today comes from --today), calls no service and knows no vendor's rules.
Defined in:
monthly_quota_pace.crConstant Summary
-
REQUIRED =
["day", "sent"] of ::String -
USAGE =
"usage: monthly-quota-pace sends.csv --quota 5000 --month 2026-11 --today 2026-11-18\nCSV columns: day (yyyy-mm-dd), sent (whole number). The quota is set by you; the tool reads no clock and knows no vendor's rules. More: https://www.onegtmlab.dev/tool-directory/sending/emailbison" -
VERSION =
"1.0.0"
Class Method Summary
-
.cli(args : Array(String), stdout : IO, stderr : IO) : Int32
Command line entry.
- .days_in_month(year : Int32, month : Int32) : Int32
-
.fmt1(num : Int128, den : Int128) : String
num / den as text with 1 decimal, rounded half away from zero.
- .leap_year?(year : Int32) : Bool
-
.pace(entries : Array(Entry), month : Month, quota : Int64, today : Int32) : Pace
today is the day of the month of --today and must lie in the month.
-
.parse_csv(text : String) : Array(Array(String))
Small CSV reader: comma separated, double quoted fields may hold commas, line breaks and "" for a quote mark.
-
.parse_date(text : String) : Tuple(Int32, Int32, Int32) | Nil
yyyy-mm-dd only; returns year, month, day or nil when it is not a real date.
- .parse_month(text : String) : Month
-
.read_entries(text : String) : Array(Entry)
Reads the day and sent columns.
- .render(p : Pace) : String
Class Method Detail
Command line entry. Returns the exit code: 0 ok, 1 bad input or file, 2 usage.
num / den as text with 1 decimal, rounded half away from zero. num must not be negative and den must be above 0.
today is the day of the month of --today and must lie in the month.
Small CSV reader: comma separated, double quoted fields may hold commas, line breaks and "" for a quote mark. Returns rows of raw cell strings.
yyyy-mm-dd only; returns year, month, day or nil when it is not a real date.
Reads the day and sent columns. The header counts as row 1.