Skip to content

Instantly share code, notes, and snippets.

@igneus
Created October 23, 2022 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igneus/bdf6338266730dd2571d8546c13e8ef3 to your computer and use it in GitHub Desktop.
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?
# 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