Created
October 23, 2022 19:45
-
-
Save igneus/bdf6338266730dd2571d8546c13e8ef3 to your computer and use it in GitHub Desktop.
Which portions of the repertory of Ordinary time Sundays are left unused in the given range of liturgical years?
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
# Which portions of the repertory of Ordinary time Sundays | |
# (lessons, corresponding chants of the Mass and Divine Office) | |
# are left unused in the given range of liturgical years? | |
require 'calendarium-romanum/cr' | |
require 'set' | |
SUNDAYS = (2..33).to_a.freeze | |
SANCTORALE = CR::Data::GENERAL_ROMAN_ENGLISH.load | |
all = Set.new | |
SUNDAYS.each do |i| | |
%w(A B C).each do |c| | |
all << "#{i}#{c}" | |
end | |
end | |
years = | |
if ARGV.empty? | |
2020 .. 2030 | |
else | |
ARGV[0].to_i .. ARGV[1].to_i | |
end | |
years.each do |year| | |
cal = CR::Calendar.new year, SANCTORALE | |
date = cal.temporale.start_date | |
loop do | |
date += 7 | |
break if date > cal.temporale.end_date | |
day = cal[date] | |
if day.season == CR::Seasons::ORDINARY && day.celebrations[0].rank.sunday? | |
all.delete "#{day.season_week}#{cal.lectionary}" | |
end | |
end | |
end | |
puts all.to_a.sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment