calendarium-romanum 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/calendariumrom +1 -1
- data/config/locales/cs.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/it.yml +1 -0
- data/config/locales/la.yml +1 -0
- data/data/czech-cs.txt +2 -1
- data/data/universal-la.txt +2 -0
- data/lib/calendarium-romanum.rb +24 -22
- data/lib/calendarium-romanum/calendar.rb +66 -16
- data/lib/calendarium-romanum/cli.rb +84 -52
- data/lib/calendarium-romanum/data.rb +12 -12
- data/lib/calendarium-romanum/day.rb +35 -14
- data/lib/calendarium-romanum/enum.rb +2 -4
- data/lib/calendarium-romanum/enums.rb +1 -1
- data/lib/calendarium-romanum/errors.rb +4 -0
- data/lib/calendarium-romanum/ordinalizer.rb +13 -1
- data/lib/calendarium-romanum/rank.rb +5 -5
- data/lib/calendarium-romanum/sanctorale.rb +2 -2
- data/lib/calendarium-romanum/sanctoraleloader.rb +31 -24
- data/lib/calendarium-romanum/temporale.rb +64 -83
- data/lib/calendarium-romanum/temporale/celebration_factory.rb +48 -0
- data/lib/calendarium-romanum/temporale/dates.rb +14 -14
- data/lib/calendarium-romanum/util.rb +22 -1
- data/lib/calendarium-romanum/version.rb +4 -1
- data/spec/calendar_spec.rb +232 -3
- data/spec/celebration_factory_spec.rb +16 -0
- data/spec/celebration_spec.rb +20 -0
- data/spec/cli_spec.rb +140 -11
- data/spec/date_parser_spec.rb +68 -0
- data/spec/date_spec.rb +8 -8
- data/spec/day_spec.rb +57 -8
- data/spec/i18n_spec.rb +0 -1
- data/spec/ordinalizer_spec.rb +29 -15
- data/spec/readme_spec.rb +4 -0
- data/spec/sanctorale_spec.rb +3 -3
- data/spec/sanctoraleloader_spec.rb +16 -11
- data/spec/spec_helper.rb +11 -0
- data/spec/temporale_spec.rb +56 -3
- metadata +6 -2
@@ -25,18 +25,18 @@ module CalendariumRomanum
|
|
25
25
|
CZECH = SanctoraleFile.new('czech-cs.txt')
|
26
26
|
] \
|
27
27
|
+
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
%w(
|
29
|
+
czech-brno-cs.txt
|
30
|
+
czech-budejovice-cs.txt
|
31
|
+
czech-cechy-cs.txt
|
32
|
+
czech-hradec-cs.txt
|
33
|
+
czech-litomerice-cs.txt
|
34
|
+
czech-morava-cs.txt
|
35
|
+
czech-olomouc-cs.txt
|
36
|
+
czech-ostrava-cs.txt
|
37
|
+
czech-plzen-cs.txt
|
38
|
+
czech-praha-cs.txt
|
39
|
+
).collect {|basename| SanctoraleFile.new(basename) }
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -4,16 +4,12 @@ module CalendariumRomanum
|
|
4
4
|
|
5
5
|
# information on one particular day of the liturgical year
|
6
6
|
class Day
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
unless args.empty?
|
15
|
-
raise ArgumentError.new "Unexpected arguments #{args.keys.join(', ')}"
|
16
|
-
end
|
7
|
+
def initialize(date: nil, season: nil, season_week: nil, celebrations: nil, vespers: nil)
|
8
|
+
@date = date
|
9
|
+
@season = season
|
10
|
+
@season_week = season_week
|
11
|
+
@celebrations = celebrations ? celebrations.dup : []
|
12
|
+
@vespers = vespers
|
17
13
|
end
|
18
14
|
|
19
15
|
attr_reader :date
|
@@ -22,7 +18,7 @@ module CalendariumRomanum
|
|
22
18
|
date.wday
|
23
19
|
end
|
24
20
|
|
25
|
-
# one of the Seasons
|
21
|
+
# one of the Seasons
|
26
22
|
attr_reader :season
|
27
23
|
|
28
24
|
# week of the season (Integer)
|
@@ -31,12 +27,25 @@ module CalendariumRomanum
|
|
31
27
|
# an Array of Celebrations, possibly empty
|
32
28
|
attr_reader :celebrations
|
33
29
|
|
30
|
+
# nil or Celebration from which first Vespers are celebrated
|
31
|
+
# instead of Vespers of the day's other Celebrations.
|
32
|
+
# Please note that Calendar by default *doesn't* populate
|
33
|
+
# Vespers, - it's an opt-in feature.
|
34
|
+
attr_reader :vespers
|
35
|
+
|
34
36
|
def ==(other)
|
35
37
|
self.class == other.class &&
|
36
38
|
date == other.date &&
|
37
39
|
season == other.season &&
|
38
40
|
season_week == other.season_week &&
|
39
|
-
celebrations == other.celebrations
|
41
|
+
celebrations == other.celebrations &&
|
42
|
+
vespers == other.vespers
|
43
|
+
end
|
44
|
+
|
45
|
+
# Are the day's Vespers suppressed in favour of first Vespers
|
46
|
+
# of a Sunday or solemnity?
|
47
|
+
def vespers_from_following?
|
48
|
+
!vespers.nil?
|
40
49
|
end
|
41
50
|
end
|
42
51
|
|
@@ -47,10 +56,11 @@ module CalendariumRomanum
|
|
47
56
|
class Celebration
|
48
57
|
extend Forwardable
|
49
58
|
|
50
|
-
def initialize(title='', rank=Ranks::FERIAL, colour=Colours::GREEN)
|
59
|
+
def initialize(title = '', rank = Ranks::FERIAL, colour = Colours::GREEN, symbol = nil)
|
51
60
|
@title = title
|
52
61
|
@rank = rank
|
53
62
|
@colour = colour
|
63
|
+
@symbol = symbol
|
54
64
|
end
|
55
65
|
|
56
66
|
attr_reader :rank
|
@@ -65,7 +75,9 @@ module CalendariumRomanum
|
|
65
75
|
end
|
66
76
|
|
67
77
|
attr_reader :colour
|
68
|
-
|
78
|
+
alias color colour
|
79
|
+
|
80
|
+
attr_reader :symbol
|
69
81
|
|
70
82
|
def ==(other)
|
71
83
|
self.class == other.class &&
|
@@ -73,5 +85,14 @@ module CalendariumRomanum
|
|
73
85
|
rank == other.rank &&
|
74
86
|
colour == other.colour
|
75
87
|
end
|
88
|
+
|
89
|
+
def change(title: nil, rank: nil, colour: nil, color: nil, symbol: nil)
|
90
|
+
self.class.new(
|
91
|
+
title || self.title,
|
92
|
+
rank || self.rank,
|
93
|
+
colour || color || self.colour,
|
94
|
+
symbol || self.symbol
|
95
|
+
)
|
96
|
+
end
|
76
97
|
end
|
77
98
|
end
|
@@ -6,7 +6,7 @@ module CalendariumRomanum
|
|
6
6
|
class << self
|
7
7
|
extend Forwardable
|
8
8
|
|
9
|
-
def values(index_by: nil
|
9
|
+
def values(index_by: nil)
|
10
10
|
defined?(@indexed) && raise(RuntimeError.new('initialized repeatedly'))
|
11
11
|
|
12
12
|
@indexed = {}
|
@@ -22,9 +22,7 @@ module CalendariumRomanum
|
|
22
22
|
@indexed.freeze
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
@all
|
27
|
-
end
|
25
|
+
attr_reader :all
|
28
26
|
|
29
27
|
def_delegators :@all, :each
|
30
28
|
def_delegators :@indexed, :[]
|
@@ -12,7 +12,8 @@ module CalendariumRomanum
|
|
12
12
|
"#{number}."
|
13
13
|
when :en
|
14
14
|
english_ordinal(number)
|
15
|
-
|
15
|
+
when :fr
|
16
|
+
french_ordinal(number)
|
16
17
|
when :la, :it
|
17
18
|
RomanNumerals.to_roman number
|
18
19
|
else
|
@@ -20,6 +21,8 @@ module CalendariumRomanum
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
24
|
+
private
|
25
|
+
|
23
26
|
def english_ordinal(number)
|
24
27
|
modulo = number % 10
|
25
28
|
modulo = 9 if number / 10 == 1
|
@@ -35,6 +38,15 @@ module CalendariumRomanum
|
|
35
38
|
"#{number}th"
|
36
39
|
end
|
37
40
|
end
|
41
|
+
|
42
|
+
def french_ordinal(number)
|
43
|
+
case number
|
44
|
+
when 1
|
45
|
+
'1er'
|
46
|
+
else
|
47
|
+
"#{number}ème"
|
48
|
+
end
|
49
|
+
end
|
38
50
|
end
|
39
51
|
end
|
40
52
|
end
|
@@ -2,27 +2,27 @@ module CalendariumRomanum
|
|
2
2
|
class Rank
|
3
3
|
include Comparable
|
4
4
|
|
5
|
-
def initialize(priority=nil, desc=nil, short_desc=nil)
|
5
|
+
def initialize(priority = nil, desc = nil, short_desc = nil)
|
6
6
|
@priority = priority
|
7
7
|
@desc = desc
|
8
8
|
@short_desc = short_desc
|
9
9
|
end
|
10
10
|
|
11
11
|
attr_reader :priority
|
12
|
-
|
12
|
+
alias to_f priority
|
13
13
|
|
14
14
|
def desc
|
15
15
|
@desc && I18n.t(@desc)
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
alias to_s desc
|
19
19
|
|
20
20
|
def short_desc
|
21
21
|
@short_desc && I18n.t(@short_desc)
|
22
22
|
end
|
23
23
|
|
24
|
-
def <=>(
|
25
|
-
|
24
|
+
def <=>(other)
|
25
|
+
other.priority <=> priority
|
26
26
|
end
|
27
27
|
|
28
28
|
def solemnity?
|
@@ -66,7 +66,7 @@ module CalendariumRomanum
|
|
66
66
|
end
|
67
67
|
|
68
68
|
date = AbstractDate.new(month, day)
|
69
|
-
|
69
|
+
@days[date] || []
|
70
70
|
end
|
71
71
|
|
72
72
|
# for each day for which an entry is available
|
@@ -88,7 +88,7 @@ module CalendariumRomanum
|
|
88
88
|
|
89
89
|
def freeze
|
90
90
|
@days.freeze
|
91
|
-
@days.values.each
|
91
|
+
@days.values.each(&:freeze)
|
92
92
|
@solemnities.freeze
|
93
93
|
super
|
94
94
|
end
|
@@ -12,22 +12,22 @@ module CalendariumRomanum
|
|
12
12
|
class SanctoraleLoader
|
13
13
|
|
14
14
|
RANK_CODES = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
nil => Ranks::MEMORIAL_OPTIONAL,
|
16
|
+
'm' => Ranks::MEMORIAL_GENERAL,
|
17
|
+
'f' => Ranks::FEAST_GENERAL,
|
18
|
+
's' => Ranks::SOLEMNITY_GENERAL
|
19
|
+
}.freeze
|
20
20
|
COLOUR_CODES = {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
nil => Colours::WHITE,
|
22
|
+
'w' => Colours::WHITE,
|
23
|
+
'v' => Colours::VIOLET,
|
24
|
+
'g' => Colours::GREEN,
|
25
|
+
'r' => Colours::RED
|
26
|
+
}.freeze
|
27
27
|
|
28
28
|
# dest should be a Sanctorale,
|
29
29
|
# src anything with #each_line
|
30
|
-
def load(src, dest=nil)
|
30
|
+
def load(src, dest = nil)
|
31
31
|
dest ||= Sanctorale.new
|
32
32
|
|
33
33
|
in_front_matter = false
|
@@ -51,7 +51,7 @@ module CalendariumRomanum
|
|
51
51
|
next if l.empty?
|
52
52
|
|
53
53
|
# month section heading
|
54
|
-
n = l.match
|
54
|
+
n = l.match(/^=\s*(\d+)\s*$/)
|
55
55
|
unless n.nil?
|
56
56
|
month_section = n[1].to_i
|
57
57
|
unless month_section >= 1 && month_section <= 12
|
@@ -61,10 +61,9 @@ module CalendariumRomanum
|
|
61
61
|
end
|
62
62
|
|
63
63
|
# celebration record
|
64
|
-
m = l.match
|
64
|
+
m = l.match(/^((\d+)\/)?(\d+)\s*(([mfs])?(\d\.\d{1,2})?)?\s*([WVRG])?\s*:(.*)$/i)
|
65
65
|
if m.nil?
|
66
66
|
raise error("Syntax error, line skipped '#{l}'", line_num)
|
67
|
-
next
|
68
67
|
end
|
69
68
|
|
70
69
|
month, day, rank_char, rank_num, colour, title = m.values_at(2, 3, 5, 6, 7, 8)
|
@@ -90,26 +89,34 @@ module CalendariumRomanum
|
|
90
89
|
rank = rank_by_num
|
91
90
|
end
|
92
91
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
begin
|
93
|
+
dest.add(
|
94
|
+
month,
|
95
|
+
day,
|
96
|
+
Celebration.new(
|
97
|
+
title.strip,
|
98
|
+
rank,
|
99
|
+
COLOUR_CODES[colour && colour.downcase]
|
100
|
+
)
|
101
|
+
)
|
102
|
+
rescue RangeError => err
|
103
|
+
raise error(err.message, line_num)
|
104
|
+
end
|
98
105
|
end
|
99
106
|
|
100
107
|
dest
|
101
108
|
end
|
102
109
|
|
103
|
-
|
110
|
+
alias load_from_string load
|
104
111
|
|
105
|
-
def load_from_file(filename, dest=nil, encoding='utf-8')
|
106
|
-
|
112
|
+
def load_from_file(filename, dest = nil, encoding = 'utf-8')
|
113
|
+
load File.open(filename, 'r', encoding: encoding), dest
|
107
114
|
end
|
108
115
|
|
109
116
|
private
|
110
117
|
|
111
118
|
def error(message, line_number)
|
112
|
-
|
119
|
+
InvalidDataError.new("L#{line_number}: #{message}")
|
113
120
|
end
|
114
121
|
end
|
115
122
|
end
|
@@ -33,13 +33,13 @@ module CalendariumRomanum
|
|
33
33
|
return year - 1
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
year
|
37
37
|
end
|
38
38
|
|
39
39
|
# creates a Calendar for the liturgical year including given
|
40
40
|
# date
|
41
41
|
def for_day(date)
|
42
|
-
|
42
|
+
new(liturgical_year(date))
|
43
43
|
end
|
44
44
|
|
45
45
|
C = Struct.new(:date_method, :celebration)
|
@@ -49,43 +49,37 @@ module CalendariumRomanum
|
|
49
49
|
def celebrations
|
50
50
|
@celebrations ||=
|
51
51
|
begin
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
52
|
+
%i(
|
53
|
+
nativity
|
54
|
+
holy_family
|
55
|
+
mother_of_god
|
56
|
+
epiphany
|
57
|
+
baptism_of_lord
|
58
|
+
ash_wednesday
|
59
|
+
good_friday
|
60
|
+
holy_saturday
|
61
|
+
palm_sunday
|
62
|
+
easter_sunday
|
63
|
+
ascension
|
64
|
+
pentecost
|
65
|
+
holy_trinity
|
66
|
+
corpus_christi
|
67
|
+
sacred_heart
|
68
|
+
christ_king
|
69
|
+
immaculate_heart
|
70
|
+
).collect do |symbol|
|
71
|
+
date_method = symbol
|
72
|
+
C.new(
|
73
|
+
date_method,
|
74
|
+
CelebrationFactory.public_send(symbol)
|
75
|
+
)
|
76
|
+
end
|
77
|
+
# Immaculate Heart of Mary is actually (currently the only one)
|
78
|
+
# movable *sanctorale* feast, but as it would make little sense
|
79
|
+
# to add support for movable sanctorale feasts because of
|
80
|
+
# a single one, we cheat a bit and handle it in temporale.
|
76
81
|
end
|
77
82
|
end
|
78
|
-
|
79
|
-
private
|
80
|
-
|
81
|
-
def c(date_method, rank, colour=Colours::WHITE)
|
82
|
-
title = proc { I18n.t("temporale.solemnity.#{date_method}") }
|
83
|
-
|
84
|
-
C.new(
|
85
|
-
date_method,
|
86
|
-
Celebration.new(title, rank, colour)
|
87
|
-
)
|
88
|
-
end
|
89
83
|
end
|
90
84
|
|
91
85
|
def transferred_to_sunday?(solemnity)
|
@@ -97,7 +91,7 @@ module CalendariumRomanum
|
|
97
91
|
end
|
98
92
|
|
99
93
|
def end_date
|
100
|
-
Dates.first_advent_sunday(year+1) - 1
|
94
|
+
Dates.first_advent_sunday(year + 1) - 1
|
101
95
|
end
|
102
96
|
|
103
97
|
def date_range
|
@@ -113,26 +107,8 @@ module CalendariumRomanum
|
|
113
107
|
end
|
114
108
|
end
|
115
109
|
|
116
|
-
|
117
|
-
|
118
|
-
nativity
|
119
|
-
holy_family
|
120
|
-
mother_of_god
|
121
|
-
epiphany
|
122
|
-
baptism_of_lord
|
123
|
-
ash_wednesday
|
124
|
-
palm_sunday
|
125
|
-
good_friday
|
126
|
-
holy_saturday
|
127
|
-
easter_sunday
|
128
|
-
ascension
|
129
|
-
pentecost
|
130
|
-
holy_trinity
|
131
|
-
corpus_christi
|
132
|
-
sacred_heart
|
133
|
-
immaculate_heart
|
134
|
-
christ_king
|
135
|
-
).each do |feast|
|
110
|
+
(celebrations.collect(&:date_method) + [:first_advent_sunday])
|
111
|
+
.each do |feast|
|
136
112
|
if SUNDAY_TRANSFERABLE_SOLEMNITIES.include? feast
|
137
113
|
define_method feast do
|
138
114
|
Dates.public_send feast, year, sunday: transferred_to_sunday?(feast)
|
@@ -152,20 +128,20 @@ module CalendariumRomanum
|
|
152
128
|
def season(date)
|
153
129
|
range_check date
|
154
130
|
|
155
|
-
if first_advent_sunday <= date
|
156
|
-
|
131
|
+
if (first_advent_sunday <= date) &&
|
132
|
+
nativity > date
|
157
133
|
Seasons::ADVENT
|
158
134
|
|
159
|
-
elsif nativity <= date
|
160
|
-
|
135
|
+
elsif (nativity <= date) &&
|
136
|
+
(baptism_of_lord >= date)
|
161
137
|
Seasons::CHRISTMAS
|
162
138
|
|
163
|
-
elsif ash_wednesday <= date
|
164
|
-
|
139
|
+
elsif (ash_wednesday <= date) &&
|
140
|
+
easter_sunday > date
|
165
141
|
Seasons::LENT
|
166
142
|
|
167
|
-
elsif easter_sunday <= date
|
168
|
-
|
143
|
+
elsif (easter_sunday <= date) &&
|
144
|
+
(pentecost >= date)
|
169
145
|
Seasons::EASTER
|
170
146
|
|
171
147
|
else
|
@@ -183,8 +159,10 @@ module CalendariumRomanum
|
|
183
159
|
ash_wednesday
|
184
160
|
when Seasons::EASTER
|
185
161
|
easter_sunday
|
186
|
-
|
187
|
-
|
162
|
+
when Seasons::ORDINARY # ordinary time
|
163
|
+
baptism_of_lord + 1
|
164
|
+
else
|
165
|
+
raise ArgumentError.new('unsupported season')
|
188
166
|
end
|
189
167
|
end
|
190
168
|
|
@@ -202,13 +180,13 @@ module CalendariumRomanum
|
|
202
180
|
week += 1
|
203
181
|
|
204
182
|
if date > pentecost
|
205
|
-
weeks_after_date = date_difference(Dates.first_advent_sunday(@year + 1), date) /
|
183
|
+
weeks_after_date = date_difference(Dates.first_advent_sunday(@year + 1), date) / WEEK
|
206
184
|
week = 34 - weeks_after_date
|
207
185
|
week += 1 if date.sunday?
|
208
186
|
end
|
209
187
|
end
|
210
188
|
|
211
|
-
|
189
|
+
week
|
212
190
|
end
|
213
191
|
|
214
192
|
# returns a Celebration
|
@@ -226,7 +204,7 @@ module CalendariumRomanum
|
|
226
204
|
end
|
227
205
|
end
|
228
206
|
|
229
|
-
|
207
|
+
@solemnities[date] || @feasts[date] || sunday(date) || @memorials[date] || ferial(date)
|
230
208
|
end
|
231
209
|
|
232
210
|
private
|
@@ -246,7 +224,7 @@ module CalendariumRomanum
|
|
246
224
|
week = Ordinalizer.ordinal season_week(seas, date)
|
247
225
|
title = I18n.t "temporale.#{seas.to_sym}.sunday", week: week
|
248
226
|
|
249
|
-
|
227
|
+
Celebration.new title, rank, seas.colour
|
250
228
|
end
|
251
229
|
|
252
230
|
def ferial(date)
|
@@ -258,6 +236,8 @@ module CalendariumRomanum
|
|
258
236
|
when Seasons::ADVENT
|
259
237
|
if date >= Date.new(@year, 12, 17)
|
260
238
|
rank = Ranks::FERIAL_PRIVILEGED
|
239
|
+
nth = Ordinalizer.ordinal(date.day)
|
240
|
+
title = I18n.t 'temporale.advent.before_christmas', day: nth
|
261
241
|
end
|
262
242
|
when Seasons::CHRISTMAS
|
263
243
|
if date < mother_of_god
|
@@ -266,32 +246,32 @@ module CalendariumRomanum
|
|
266
246
|
nth = Ordinalizer.ordinal(date.day - nativity.day + 1) # 1-based counting
|
267
247
|
title = I18n.t 'temporale.christmas.nativity_octave.ferial', day: nth
|
268
248
|
elsif date > epiphany
|
269
|
-
title = I18n.t
|
249
|
+
title = I18n.t 'temporale.christmas.after_epiphany.ferial', weekday: I18n.t("weekday.#{date.wday}")
|
270
250
|
end
|
271
251
|
when Seasons::LENT
|
272
252
|
if week == 0
|
273
|
-
title = I18n.t
|
253
|
+
title = I18n.t 'temporale.lent.after_ashes.ferial', weekday: I18n.t("weekday.#{date.wday}")
|
274
254
|
elsif date > palm_sunday
|
275
255
|
rank = Ranks::PRIMARY
|
276
|
-
title = I18n.t
|
256
|
+
title = I18n.t 'temporale.lent.holy_week.ferial', weekday: I18n.t("weekday.#{date.wday}")
|
277
257
|
end
|
278
258
|
rank = Ranks::FERIAL_PRIVILEGED unless rank > Ranks::FERIAL_PRIVILEGED
|
279
259
|
when Seasons::EASTER
|
280
260
|
if week == 1
|
281
261
|
rank = Ranks::PRIMARY
|
282
|
-
title = I18n.t
|
262
|
+
title = I18n.t 'temporale.easter.octave.ferial', weekday: I18n.t("weekday.#{date.wday}")
|
283
263
|
end
|
284
264
|
end
|
285
265
|
|
286
266
|
week_ord = Ordinalizer.ordinal week
|
287
267
|
title ||= I18n.t "temporale.#{seas.to_sym}.ferial", week: week_ord, weekday: I18n.t("weekday.#{date.wday}")
|
288
268
|
|
289
|
-
|
269
|
+
Celebration.new title, rank, seas.colour
|
290
270
|
end
|
291
271
|
|
292
272
|
# helper: difference between two Dates in days
|
293
273
|
def date_difference(d1, d2)
|
294
|
-
|
274
|
+
(d1 - d2).numerator
|
295
275
|
end
|
296
276
|
|
297
277
|
# prepare dates of temporale solemnities
|
@@ -317,11 +297,12 @@ module CalendariumRomanum
|
|
317
297
|
end
|
318
298
|
|
319
299
|
def prepare_celebration_date(date_method, celebration)
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
300
|
+
date =
|
301
|
+
if date_method.respond_to? :call
|
302
|
+
date_method.call(year)
|
303
|
+
else
|
304
|
+
public_send(date_method)
|
305
|
+
end
|
325
306
|
|
326
307
|
add_to =
|
327
308
|
if celebration.feast?
|