calendarium-romanum 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/locales/en.yml +37 -0
- data/lib/calendarium-romanum.rb +3 -0
- data/lib/calendarium-romanum/enums.rb +15 -50
- data/lib/calendarium-romanum/i18n_setup.rb +3 -0
- data/lib/calendarium-romanum/rank.rb +36 -0
- data/lib/calendarium-romanum/sanctorale_factory.rb +22 -0
- data/lib/calendarium-romanum/sanctoraleloader.rb +7 -3
- data/lib/calendarium-romanum/temporale.rb +22 -16
- data/lib/calendarium-romanum/version.rb +1 -1
- data/spec/calendar_spec.rb +1 -1
- data/spec/data_spec.rb +15 -0
- data/spec/rank_spec.rb +12 -0
- data/spec/sanctorale_factory_spec.rb +42 -0
- data/spec/sanctoraleloader_spec.rb +16 -16
- data/spec/temporale_spec.rb +8 -0
- metadata +63 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d9416336650b1b52c5a3f1571502c729087d9ed
|
4
|
+
data.tar.gz: 9cc5dc9dd4f74a2547ce6cecc8d1c987d8f00ef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c08b9111fafce69fbd197e586e72a9e6cd12c45104ff9999a2a7b39caf5991867f6206bea88541314397227b957afa4c67d54e3ddd26c7ebe8df933ae34ead6
|
7
|
+
data.tar.gz: 89c76fbacdb3d389364c5624d7638acd279b634436a2c8c3d56a843253a554c3f3f8a9bd5ef5e888fa149c8851c2a0b40021679d6a77f9772e458ee78d65967d
|
@@ -0,0 +1,37 @@
|
|
1
|
+
en:
|
2
|
+
temporale:
|
3
|
+
solemnity:
|
4
|
+
nativity: The Nativity of the Lord
|
5
|
+
holy_family: The Holy Family of Jesus, Mary and Joseph
|
6
|
+
mother_of_god: Octave Day of Christmas, of Mary, Mother of God
|
7
|
+
epiphany: The Epiphany of the Lord
|
8
|
+
baptism_of_lord: The Baptism of the Lord
|
9
|
+
good_friday: Friday of the Passion of the Lord
|
10
|
+
holy_saturday: Holy Saturday
|
11
|
+
easter_sunday: Easter Sunday of the Resurrection of the Lord
|
12
|
+
pentecost: Pentecost Sunday
|
13
|
+
holy_trinity: The Most Holy Trinity
|
14
|
+
body_blood: The Most Holy Body and Blood of Christ
|
15
|
+
sacred_heart: The Most Sacred Heart of Jesus
|
16
|
+
christ_king: Our Lord Jesus Christ, King of the Universe
|
17
|
+
rank:
|
18
|
+
'1_1': Easter triduum
|
19
|
+
'1_2': Primary liturgical days
|
20
|
+
'1_3': Solemnities in the General Calendar
|
21
|
+
'1_4': Proper solemnities
|
22
|
+
'2_5': Feasts of the Lord in the General Calendar
|
23
|
+
'2_6': Unprivileged Sundays
|
24
|
+
'2_7': Feasts of saints in the General Calendar
|
25
|
+
'2_8': Proper feasts
|
26
|
+
'2_9': Privileged ferials
|
27
|
+
'3_10': Obligatory memorials in the General Calendar
|
28
|
+
'3_11': Proper obligatory memorials
|
29
|
+
'3_12': Optional memorials
|
30
|
+
'3_13': Unprivileged ferials
|
31
|
+
short:
|
32
|
+
solemnity: solemnity
|
33
|
+
feast: feast
|
34
|
+
sunday: Sunday
|
35
|
+
memorial: memorial
|
36
|
+
memorial_opt: optional memorial
|
37
|
+
ferial: ferial
|
data/lib/calendarium-romanum.rb
CHANGED
@@ -12,61 +12,26 @@ module CalendariumRomanum
|
|
12
12
|
|
13
13
|
LECTIONARY_CYCLES = [:A, :B, :C]
|
14
14
|
|
15
|
-
class Rank < Struct.new(:priority, :desc, :short_desc)
|
16
|
-
include Comparable
|
17
|
-
|
18
|
-
@@instances = {}
|
19
|
-
|
20
|
-
def initialize(*args)
|
21
|
-
super(*args)
|
22
|
-
|
23
|
-
@@instances[self.priority] = self
|
24
|
-
end
|
25
|
-
|
26
|
-
def <=>(b)
|
27
|
-
b.priority <=> self.priority
|
28
|
-
end
|
29
|
-
|
30
|
-
alias_method :to_f, :priority
|
31
|
-
alias_method :to_s, :desc
|
32
|
-
|
33
|
-
def self.[](priority)
|
34
|
-
@@instances[priority]
|
35
|
-
end
|
36
|
-
|
37
|
-
def solemnity?
|
38
|
-
priority.to_i == 1
|
39
|
-
end
|
40
|
-
|
41
|
-
def feast?
|
42
|
-
priority.to_i == 2
|
43
|
-
end
|
44
|
-
|
45
|
-
def memorial?
|
46
|
-
priority.to_i == 3
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
15
|
# ranks of celebrations
|
51
16
|
module Ranks
|
52
17
|
# Values are at the same time references to sections
|
53
18
|
# of the Table of Liturgical Days.
|
54
19
|
# The lower value, the higher rank.
|
55
|
-
TRIDUUM = Rank.new 1.1, '
|
56
|
-
PRIMARY = Rank.new 1.2, '
|
57
|
-
SOLEMNITY_GENERAL = Rank.new 1.3, '
|
58
|
-
SOLEMNITY_PROPER = Rank.new 1.4, '
|
59
|
-
|
60
|
-
FEAST_LORD_GENERAL = Rank.new 2.5, '
|
61
|
-
SUNDAY_UNPRIVILEGED = Rank.new 2.6, '
|
62
|
-
FEAST_GENERAL = Rank.new 2.7, '
|
63
|
-
FEAST_PROPER = Rank.new 2.8, '
|
64
|
-
FERIAL_PRIVILEGED = Rank.new 2.9, '
|
65
|
-
|
66
|
-
MEMORIAL_GENERAL = Rank.new 3.10, '
|
67
|
-
MEMORIAL_PROPER = Rank.new 3.11, '
|
68
|
-
MEMORIAL_OPTIONAL = Rank.new 3.12, '
|
69
|
-
FERIAL = Rank.new 3.13, '
|
20
|
+
TRIDUUM = Rank.new 1.1, I18n.t('rank.1_1')
|
21
|
+
PRIMARY = Rank.new 1.2, I18n.t('rank.1_2') # description may not be exact
|
22
|
+
SOLEMNITY_GENERAL = Rank.new 1.3, I18n.t('rank.1_3'), I18n.t('rank.short.solemnity') # description may not be exact
|
23
|
+
SOLEMNITY_PROPER = Rank.new 1.4, I18n.t('rank.1_4'), I18n.t('rank.short.solemnity')
|
24
|
+
|
25
|
+
FEAST_LORD_GENERAL = Rank.new 2.5, I18n.t('rank.2_5'), I18n.t('rank.short.feast')
|
26
|
+
SUNDAY_UNPRIVILEGED = Rank.new 2.6, I18n.t('rank.2_6'), I18n.t('rank.short.sunday')
|
27
|
+
FEAST_GENERAL = Rank.new 2.7, I18n.t('rank.2_7'), I18n.t('rank.short.feast')
|
28
|
+
FEAST_PROPER = Rank.new 2.8, I18n.t('rank.2_8'), I18n.t('rank.short.feast')
|
29
|
+
FERIAL_PRIVILEGED = Rank.new 2.9, I18n.t('rank.2_9'), I18n.t('rank.short.ferial')
|
30
|
+
|
31
|
+
MEMORIAL_GENERAL = Rank.new 3.10, I18n.t('rank.3_10'), I18n.t('rank.short.memorial')
|
32
|
+
MEMORIAL_PROPER = Rank.new 3.11, I18n.t('rank.3_11'), I18n.t('rank.short.memorial')
|
33
|
+
MEMORIAL_OPTIONAL = Rank.new 3.12, I18n.t('rank.3_12'), I18n.t('rank.short.memorial_opt')
|
34
|
+
FERIAL = Rank.new 3.13, I18n.t('rank.3_13'), I18n.t('rank.short.ferial')
|
70
35
|
|
71
36
|
def self.[](priority)
|
72
37
|
Rank[priority]
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module CalendariumRomanum
|
2
|
+
class Rank < Struct.new(:priority, :desc, :short_desc)
|
3
|
+
include Comparable
|
4
|
+
|
5
|
+
@@instances = {}
|
6
|
+
|
7
|
+
def initialize(*args)
|
8
|
+
super(*args)
|
9
|
+
|
10
|
+
@@instances[self.priority] = self
|
11
|
+
end
|
12
|
+
|
13
|
+
def <=>(b)
|
14
|
+
b.priority <=> self.priority
|
15
|
+
end
|
16
|
+
|
17
|
+
alias_method :to_f, :priority
|
18
|
+
alias_method :to_s, :desc
|
19
|
+
|
20
|
+
def self.[](priority)
|
21
|
+
@@instances[priority]
|
22
|
+
end
|
23
|
+
|
24
|
+
def solemnity?
|
25
|
+
priority.to_i == 1
|
26
|
+
end
|
27
|
+
|
28
|
+
def feast?
|
29
|
+
priority.to_i == 2
|
30
|
+
end
|
31
|
+
|
32
|
+
def memorial?
|
33
|
+
priority.to_i == 3
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module CalendariumRomanum
|
2
|
+
# conveniently creates sanctorale from several data files
|
3
|
+
class SanctoraleFactory
|
4
|
+
class << self
|
5
|
+
# layers several sanctorale instances.
|
6
|
+
def create_layered(*instances)
|
7
|
+
r = Sanctorale.new
|
8
|
+
instances.each {|i| r.update i }
|
9
|
+
r
|
10
|
+
end
|
11
|
+
|
12
|
+
# loads and layers several sanctorale instances.
|
13
|
+
def load_layered_from_files(*paths)
|
14
|
+
loader = SanctoraleLoader.new
|
15
|
+
instances = paths.collect do |p|
|
16
|
+
loader.load_from_file p
|
17
|
+
end
|
18
|
+
create_layered(*instances)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -27,7 +27,9 @@ module CalendariumRomanum
|
|
27
27
|
|
28
28
|
# dest should be a Sanctorale,
|
29
29
|
# src anything with #each_line
|
30
|
-
def load(
|
30
|
+
def load(src, dest=nil)
|
31
|
+
dest ||= Sanctorale.new
|
32
|
+
|
31
33
|
month_section = nil
|
32
34
|
src.each_line.each_with_index do |l, li|
|
33
35
|
line_num = li + 1
|
@@ -83,12 +85,14 @@ module CalendariumRomanum
|
|
83
85
|
COLOUR_CODES[colour]
|
84
86
|
)
|
85
87
|
end
|
88
|
+
|
89
|
+
dest
|
86
90
|
end
|
87
91
|
|
88
92
|
alias_method :load_from_string, :load
|
89
93
|
|
90
|
-
def load_from_file(
|
91
|
-
self.load
|
94
|
+
def load_from_file(filename, dest=nil, encoding='utf-8')
|
95
|
+
self.load File.open(filename, 'r', encoding: encoding), dest
|
92
96
|
end
|
93
97
|
|
94
98
|
private
|
@@ -129,7 +129,13 @@ module CalendariumRomanum
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def holy_family(year=nil)
|
132
|
-
|
132
|
+
year ||= @year
|
133
|
+
xmas = nativity(year)
|
134
|
+
if xmas.sunday?
|
135
|
+
return Date.new(year, 12, 30)
|
136
|
+
else
|
137
|
+
sunday_after(xmas)
|
138
|
+
end
|
133
139
|
end
|
134
140
|
|
135
141
|
def mother_of_god(year=nil)
|
@@ -356,24 +362,24 @@ module CalendariumRomanum
|
|
356
362
|
@solemnities = {}
|
357
363
|
|
358
364
|
{
|
359
|
-
nativity: [
|
360
|
-
holy_family: [
|
361
|
-
mother_of_god: [
|
362
|
-
epiphany: [
|
363
|
-
baptism_of_lord: [
|
364
|
-
good_friday: [
|
365
|
-
holy_saturday: [
|
366
|
-
easter_sunday: [
|
367
|
-
pentecost: [
|
368
|
-
holy_trinity: [
|
369
|
-
body_blood: [
|
370
|
-
sacred_heart: [
|
371
|
-
christ_king: [
|
365
|
+
nativity: [nil, nil],
|
366
|
+
holy_family: [Ranks::FEAST_LORD_GENERAL, nil],
|
367
|
+
mother_of_god: [Ranks::SOLEMNITY_GENERAL],
|
368
|
+
epiphany: [nil, nil],
|
369
|
+
baptism_of_lord: [Ranks::FEAST_LORD_GENERAL, nil],
|
370
|
+
good_friday: [Ranks::TRIDUUM, Colours::RED],
|
371
|
+
holy_saturday: [Ranks::TRIDUUM, nil],
|
372
|
+
easter_sunday: [Ranks::TRIDUUM, nil],
|
373
|
+
pentecost: [nil, Colours::RED],
|
374
|
+
holy_trinity: [Ranks::SOLEMNITY_GENERAL, Colours::WHITE],
|
375
|
+
body_blood: [Ranks::SOLEMNITY_GENERAL, Colours::WHITE],
|
376
|
+
sacred_heart: [Ranks::SOLEMNITY_GENERAL, Colours::WHITE],
|
377
|
+
christ_king: [Ranks::SOLEMNITY_GENERAL, Colours::WHITE],
|
372
378
|
}.each_pair do |method_name, data|
|
373
379
|
date = send(method_name)
|
374
|
-
|
380
|
+
rank, colour = data
|
375
381
|
@solemnities[date] = Celebration.new(
|
376
|
-
|
382
|
+
I18n.t("temporale.solemnity.#{method_name}"),
|
377
383
|
rank || Ranks::PRIMARY,
|
378
384
|
colour || SEASON_COLOUR[season(date)]
|
379
385
|
)
|
data/spec/calendar_spec.rb
CHANGED
@@ -108,7 +108,7 @@ describe CR::Calendar do
|
|
108
108
|
before :all do
|
109
109
|
@s = CR::Sanctorale.new
|
110
110
|
loader = CR::SanctoraleLoader.new
|
111
|
-
loader.load_from_file(
|
111
|
+
loader.load_from_file(File.join(File.dirname(__FILE__), '..', 'data', 'universal-en.txt'), @s)
|
112
112
|
@c = described_class.new 2013, @s
|
113
113
|
end
|
114
114
|
|
data/spec/data_spec.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe 'sanctorale data files' do
|
4
|
+
let(:loader) { CR::SanctoraleLoader.new }
|
5
|
+
|
6
|
+
data_path = File.expand_path '../data', File.dirname(__FILE__)
|
7
|
+
glob = File.join(data_path, '*.txt')
|
8
|
+
|
9
|
+
Dir[glob].each do |file|
|
10
|
+
it "#{file} is loadable" do
|
11
|
+
sanctorale = loader.load_from_file file
|
12
|
+
expect(sanctorale).not_to be_empty
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/spec/rank_spec.rb
CHANGED
@@ -27,4 +27,16 @@ describe CR::Rank do
|
|
27
27
|
it { expect(CR::Ranks[1.2]).to be == CR::Ranks[1.2] }
|
28
28
|
it { expect(CR::Ranks[1.2]).not_to be == CR::Ranks[1.1] }
|
29
29
|
end
|
30
|
+
|
31
|
+
describe '#desc' do
|
32
|
+
it { expect(CR::Ranks[1.1].desc).to eq 'Easter triduum' }
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#short_desc' do
|
36
|
+
it 'is not always set' do
|
37
|
+
expect(CR::Ranks[1.1].short_desc).to be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
it { expect(CR::Ranks[2.8].short_desc).to eq 'feast' }
|
41
|
+
end
|
30
42
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe CR::SanctoraleFactory do
|
5
|
+
describe '.create_layered'
|
6
|
+
|
7
|
+
describe '.load_layered_from_files' do
|
8
|
+
before :each do
|
9
|
+
files = %w(czech-cs.txt czech-cechy-cs.txt czech-budejovice-cs.txt).collect do |f|
|
10
|
+
File.join(File.expand_path('../data', File.dirname(__FILE__)), f)
|
11
|
+
end
|
12
|
+
@s = described_class.load_layered_from_files(*files)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has celebrations from the first file' do
|
16
|
+
dd = @s.get 9, 28
|
17
|
+
expect(dd.size).to eq 1
|
18
|
+
|
19
|
+
d = dd.first
|
20
|
+
expect(d.rank).to eq CR::Ranks::SOLEMNITY_PROPER
|
21
|
+
expect(d.title).to eq 'Sv. Václava, mučedníka, hlavního patrona českého národa'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'has celebrations from the second file' do
|
25
|
+
dd = @s.get 7, 4
|
26
|
+
expect(dd.size).to eq 1
|
27
|
+
|
28
|
+
d = dd.first
|
29
|
+
expect(d.rank).to eq CR::Ranks::MEMORIAL_PROPER
|
30
|
+
expect(d.title).to eq 'Sv. Prokopa, opata'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'celebrations from the last file win' do
|
34
|
+
dd = @s.get 12, 22
|
35
|
+
expect(dd.size).to eq 1
|
36
|
+
|
37
|
+
d = dd.first
|
38
|
+
expect(d.rank).to eq CR::Ranks::FEAST_PROPER
|
39
|
+
expect(d.title).to eq 'Výročí posvěcení katedrály sv. Mikuláše'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -8,10 +8,10 @@ describe CR::SanctoraleLoader do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe 'data sources' do
|
11
|
-
describe '
|
11
|
+
describe '#load_from_string' do
|
12
12
|
before :each do
|
13
13
|
str = '1/3 : Ss.mi Nominis Iesu'
|
14
|
-
@l.load_from_string @s
|
14
|
+
@l.load_from_string str, @s
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'loads one entry' do
|
@@ -36,14 +36,14 @@ describe CR::SanctoraleLoader do
|
|
36
36
|
|
37
37
|
it 'loads explicit rank if given' do
|
38
38
|
str = '1/25 f : In conversione S. Pauli, apostoli'
|
39
|
-
@l.load_from_string @s
|
39
|
+
@l.load_from_string str, @s
|
40
40
|
expect(@s.get(1, 25)[0].rank).to eq CR::Ranks::FEAST_GENERAL
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe '
|
44
|
+
describe '#load_from_file' do
|
45
45
|
it 'loads something from file' do
|
46
|
-
@l.load_from_file(
|
46
|
+
@l.load_from_file(File.join(%w{data universal-la.txt}), @s)
|
47
47
|
expect(@s.size).to be > 190
|
48
48
|
end
|
49
49
|
end
|
@@ -53,7 +53,7 @@ describe CR::SanctoraleLoader do
|
|
53
53
|
describe 'month as heading' do
|
54
54
|
it 'loads a month heading and uses the month for subsequent records' do
|
55
55
|
str = ['= 1', '25 f : In conversione S. Pauli, apostoli'].join "\n"
|
56
|
-
@l.load_from_string @s
|
56
|
+
@l.load_from_string str, @s
|
57
57
|
expect(@s).not_to be_empty
|
58
58
|
expect(@s.get(1, 25)).not_to be_empty
|
59
59
|
end
|
@@ -62,7 +62,7 @@ describe CR::SanctoraleLoader do
|
|
62
62
|
describe 'colour' do
|
63
63
|
it 'sets colour if specified' do
|
64
64
|
str = '4/25 f R : S. Marci, evangelistae'
|
65
|
-
@l.load_from_string @s
|
65
|
+
@l.load_from_string str, @s
|
66
66
|
expect(@s.get(4, 25).first.colour).to eq CR::Colours::RED
|
67
67
|
end
|
68
68
|
end
|
@@ -71,7 +71,7 @@ describe CR::SanctoraleLoader do
|
|
71
71
|
it 'sets exact rank if specified' do
|
72
72
|
# say we specify a proper calendar of a church dedicated to St. George
|
73
73
|
str = '4/23 s1.4 R : S. Georgii, martyris'
|
74
|
-
@l.load_from_string @s
|
74
|
+
@l.load_from_string str, @s
|
75
75
|
celeb = @s.get(4, 23).first
|
76
76
|
expect(celeb.rank).to eq CR::Ranks::SOLEMNITY_PROPER
|
77
77
|
end
|
@@ -83,7 +83,7 @@ describe CR::SanctoraleLoader do
|
|
83
83
|
it 'invalid syntax' do
|
84
84
|
str = 'line without standard beginning'
|
85
85
|
expect do
|
86
|
-
@l.load_from_string @s
|
86
|
+
@l.load_from_string str, @s
|
87
87
|
end.to raise_exception /Syntax error/
|
88
88
|
end
|
89
89
|
end
|
@@ -92,49 +92,49 @@ describe CR::SanctoraleLoader do
|
|
92
92
|
it 'invalid month' do
|
93
93
|
str = '100/25 f : In conversione S. Pauli, apostoli'
|
94
94
|
expect do
|
95
|
-
@l.load_from_string @s
|
95
|
+
@l.load_from_string str, @s
|
96
96
|
end.to raise_exception /Invalid month/
|
97
97
|
end
|
98
98
|
|
99
99
|
it 'line with day only, without preceding month heading' do
|
100
100
|
str = '25 f : In conversione S. Pauli, apostoli'
|
101
101
|
expect do
|
102
|
-
@l.load_from_string @s
|
102
|
+
@l.load_from_string str, @s
|
103
103
|
end.to raise_exception /Invalid month/
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'invalid day' do
|
107
107
|
str = '1/250 f : In conversione S. Pauli, apostoli'
|
108
108
|
expect do
|
109
|
-
@l.load_from_string @s
|
109
|
+
@l.load_from_string str, @s
|
110
110
|
end.to raise_exception /Invalid day/
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'invalid month heading' do
|
114
114
|
str = '= 0'
|
115
115
|
expect do
|
116
|
-
@l.load_from_string @s
|
116
|
+
@l.load_from_string str, @s
|
117
117
|
end.to raise_exception /Invalid month/
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'invalid rank' do
|
121
121
|
str = '1/25 X : In conversione S. Pauli, apostoli'
|
122
122
|
expect do
|
123
|
-
@l.load_from_string @s
|
123
|
+
@l.load_from_string str, @s
|
124
124
|
end.to raise_exception /Syntax error/
|
125
125
|
end
|
126
126
|
|
127
127
|
it 'invalid numeric rank' do
|
128
128
|
str = '4/23 s8.4 R : S. Georgii, martyris'
|
129
129
|
expect do
|
130
|
-
@l.load_from_string @s
|
130
|
+
@l.load_from_string str, @s
|
131
131
|
end.to raise_exception /rank/
|
132
132
|
end
|
133
133
|
|
134
134
|
it 'invalid combination of rank latter and number' do
|
135
135
|
str = '4/23 m2.5 R : S. Georgii, martyris'
|
136
136
|
expect do
|
137
|
-
@l.load_from_string @s
|
137
|
+
@l.load_from_string str, @s
|
138
138
|
end.to raise_exception /rank/
|
139
139
|
end
|
140
140
|
end
|
data/spec/temporale_spec.rb
CHANGED
@@ -223,6 +223,14 @@ describe CR::Temporale do
|
|
223
223
|
expect(c.colour).to eq CR::Colours::WHITE
|
224
224
|
end
|
225
225
|
|
226
|
+
context 'when a Sunday does not occur between Dec 25 and Jan 1' do
|
227
|
+
it 'is Holy Family on Friday Dec 30' do
|
228
|
+
@t16 = described_class.new 2016
|
229
|
+
c = @t16.get(12, 30)
|
230
|
+
expect(c.title).to eq 'The Holy Family of Jesus, Mary and Joseph'
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
226
234
|
it 'Epiphany' do
|
227
235
|
c = @t13.get(1, 6)
|
228
236
|
expect(c.rank).to eq CR::Ranks::PRIMARY
|
metadata
CHANGED
@@ -1,29 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendarium-romanum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Pavlík
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.18'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.18'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: i18n
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.6'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '12.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '12.0'
|
13
55
|
- !ruby/object:Gem::Dependency
|
14
56
|
name: rspec
|
15
57
|
requirement: !ruby/object:Gem::Requirement
|
16
58
|
requirements:
|
17
59
|
- - "~>"
|
18
60
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2
|
61
|
+
version: '4.2'
|
20
62
|
type: :development
|
21
63
|
prerelease: false
|
22
64
|
version_requirements: !ruby/object:Gem::Requirement
|
23
65
|
requirements:
|
24
66
|
- - "~>"
|
25
67
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2
|
68
|
+
version: '4.2'
|
27
69
|
description: calendar computations according to the Roman Catholic liturgical calendar
|
28
70
|
as instituted by MP Mysterii Paschalis of Paul VI (1969).
|
29
71
|
email: jkb.pavlik@gmail.com
|
@@ -32,25 +74,31 @@ extensions: []
|
|
32
74
|
extra_rdoc_files: []
|
33
75
|
files:
|
34
76
|
- bin/calendariumrom
|
77
|
+
- config/locales/en.yml
|
35
78
|
- lib/calendarium-romanum.rb
|
36
|
-
- lib/calendarium-romanum/
|
79
|
+
- lib/calendarium-romanum/abstract_date.rb
|
37
80
|
- lib/calendarium-romanum/calendar.rb
|
38
|
-
- lib/calendarium-romanum/
|
39
|
-
- lib/calendarium-romanum/sanctorale.rb
|
40
|
-
- lib/calendarium-romanum/transfers.rb
|
81
|
+
- lib/calendarium-romanum/day.rb
|
41
82
|
- lib/calendarium-romanum/enums.rb
|
83
|
+
- lib/calendarium-romanum/i18n_setup.rb
|
84
|
+
- lib/calendarium-romanum/rank.rb
|
85
|
+
- lib/calendarium-romanum/sanctorale.rb
|
86
|
+
- lib/calendarium-romanum/sanctorale_factory.rb
|
42
87
|
- lib/calendarium-romanum/sanctoraleloader.rb
|
43
|
-
- lib/calendarium-romanum/abstract_date.rb
|
44
|
-
- lib/calendarium-romanum/version.rb
|
45
88
|
- lib/calendarium-romanum/temporale.rb
|
89
|
+
- lib/calendarium-romanum/transfers.rb
|
90
|
+
- lib/calendarium-romanum/util.rb
|
91
|
+
- lib/calendarium-romanum/version.rb
|
92
|
+
- spec/abstract_date_spec.rb
|
46
93
|
- spec/calendar_spec.rb
|
94
|
+
- spec/data_spec.rb
|
47
95
|
- spec/date_spec.rb
|
48
|
-
- spec/temporale_spec.rb
|
49
|
-
- spec/spec_helper.rb
|
50
|
-
- spec/abstract_date_spec.rb
|
51
96
|
- spec/rank_spec.rb
|
52
|
-
- spec/
|
97
|
+
- spec/sanctorale_factory_spec.rb
|
53
98
|
- spec/sanctorale_spec.rb
|
99
|
+
- spec/sanctoraleloader_spec.rb
|
100
|
+
- spec/spec_helper.rb
|
101
|
+
- spec/temporale_spec.rb
|
54
102
|
homepage: http://github.com/igneus/calendarium-romanum
|
55
103
|
licenses:
|
56
104
|
- LGPL-3.0
|
@@ -72,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
120
|
version: '0'
|
73
121
|
requirements: []
|
74
122
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.1
|
123
|
+
rubygems_version: 2.5.1
|
76
124
|
signing_key:
|
77
125
|
specification_version: 4
|
78
126
|
summary: Roman Catholic liturgical calendar computations
|