calendarium-romanum 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -13
  3. data/.yardopts +1 -1
  4. data/CHANGELOG.md +91 -0
  5. data/README.md +128 -45
  6. data/Rakefile +7 -0
  7. data/calendarium-romanum.gemspec +6 -1
  8. data/config/locales/cs.yml +2 -0
  9. data/config/locales/en.yml +4 -0
  10. data/config/locales/es.yml +4 -0
  11. data/config/locales/fr.yml +4 -0
  12. data/config/locales/it.yml +4 -0
  13. data/config/locales/la.yml +4 -0
  14. data/data/README.md +27 -23
  15. data/data/czech-cs.txt +13 -15
  16. data/data/easter_dates.txt +67 -0
  17. data/data/universal-1969-la.txt +234 -0
  18. data/data/universal-en.txt +4 -4
  19. data/data/universal-es.txt +4 -4
  20. data/data/universal-fr.txt +4 -4
  21. data/data/universal-it.txt +4 -4
  22. data/data/universal-la.txt +4 -4
  23. data/lib/calendarium-romanum.rb +5 -0
  24. data/lib/calendarium-romanum/abstract_date.rb +6 -3
  25. data/lib/calendarium-romanum/calendar.rb +37 -15
  26. data/lib/calendarium-romanum/cli.rb +49 -111
  27. data/lib/calendarium-romanum/cli/comparator.rb +63 -0
  28. data/lib/calendarium-romanum/cli/date_parser.rb +30 -0
  29. data/lib/calendarium-romanum/cli/dumper.rb +68 -0
  30. data/lib/calendarium-romanum/cli/helper.rb +23 -0
  31. data/lib/calendarium-romanum/cli/querier.rb +73 -0
  32. data/lib/calendarium-romanum/data.rb +4 -1
  33. data/lib/calendarium-romanum/day.rb +49 -40
  34. data/lib/calendarium-romanum/enum.rb +37 -39
  35. data/lib/calendarium-romanum/enums.rb +28 -4
  36. data/lib/calendarium-romanum/ordinalizer.rb +2 -2
  37. data/lib/calendarium-romanum/perpetual_calendar.rb +6 -3
  38. data/lib/calendarium-romanum/rank.rb +16 -22
  39. data/lib/calendarium-romanum/rank_predicates.rb +43 -0
  40. data/lib/calendarium-romanum/sanctorale.rb +9 -8
  41. data/lib/calendarium-romanum/sanctorale_loader.rb +7 -3
  42. data/lib/calendarium-romanum/sanctorale_writer.rb +119 -0
  43. data/lib/calendarium-romanum/temporale.rb +44 -17
  44. data/lib/calendarium-romanum/temporale/celebration_factory.rb +4 -3
  45. data/lib/calendarium-romanum/temporale/dates.rb +5 -5
  46. data/lib/calendarium-romanum/temporale/easter_table.rb +27 -0
  47. data/lib/calendarium-romanum/temporale/extensions.rb +15 -0
  48. data/lib/calendarium-romanum/temporale/extensions/christ_eternal_priest.rb +3 -2
  49. data/lib/calendarium-romanum/temporale/extensions/dedication_before_all_saints.rb +73 -0
  50. data/lib/calendarium-romanum/transfers.rb +44 -18
  51. data/lib/calendarium-romanum/util.rb +10 -24
  52. data/lib/calendarium-romanum/version.rb +2 -2
  53. data/liturgical_law/1969_normae_universales.md +568 -0
  54. data/liturgical_law/1977_decretum_de_celebratione_baptismatis_domini.md +58 -0
  55. data/liturgical_law/1990_decretum_de_variatione_inducenda.md +67 -0
  56. data/liturgical_law/1998_notificatio_de_occurrentia.md +57 -0
  57. data/liturgical_law/2002_normae_universales.md +946 -0
  58. data/liturgical_law/2006_notification.md +37 -0
  59. data/liturgical_law/2012_declarationes.md +38 -0
  60. data/liturgical_law/README.md +74 -0
  61. metadata +28 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cee5ab4345ad34eb849b0024a9d3489b29ebe55e8e960abd44ff858d911fdb32
4
- data.tar.gz: e93e85c1e668d5d57a10e0846bdb0ae37e693ac125b3c9d3b09f3dac3d5d806f
3
+ metadata.gz: 783786a54e37a2d755c2bc0a0fdf1cf21b684ce5e1f186e180fb8513a7be8a8d
4
+ data.tar.gz: 8c4879981d34a5962f604de47ec4d77faf2b63cec5adf2699cfc9d1a718d045f
5
5
  SHA512:
6
- metadata.gz: c6a4f20a4ccbb564ee51dcb24e7d354b5a9ed9495951b239ca653631fb08c48d2121989279cc3d9e93e0236721545fc62518c09b9ce8cdbd9e40ca89bff7786f
7
- data.tar.gz: ab95329b242615cb3c81bcb31b171c2ba66ffa3e8e544dc1f33721d2e6e4d6e7e0cee68d429e4ff46ce34a550d6be9af969c5ee919da54f1890141f719900d4a
6
+ metadata.gz: ba211f79a4b79ed8169d15871e8630baf2a536182284ec58e851b061a980dd18a9163a8d8749ab8f1f470f2cdec64f5c236710022f8739862d39eb8efd88bcef
7
+ data.tar.gz: 7c6be1ff8bee1e4ea3159a7add679dc7b53949dfc086b82fc63335d670f69fdfc4518d020944d3db09a22cfeb6442fe733850adaab29948618a91f3ed93a3e82
@@ -1,20 +1,22 @@
1
1
  language: ruby
2
-
2
+ cache: bundler
3
3
  dist: trusty
4
4
 
5
- rvm:
6
- - 2.0.0 # oldest MRI we support
7
- - 2.5.0 # oldest officially maintained MRI
8
- - 2.6.5 # ~ latest MRI
9
- #- jruby-9.1.12.0
10
-
11
5
  install: bundle install --jobs=3 --deployment --without development
12
6
 
13
- script: bundle exec rake spec_all_locales && bash spec/build/gem_build_test.sh
7
+ script: bundle exec rake spec
14
8
 
15
- git:
16
- depth: 3
9
+ jobs:
10
+ include:
11
+ - rvm: 2.6.5 # ~ latest MRI
12
+ script:
13
+ - bundle exec rake spec_all_locales
14
+ - bash spec/build/gem_build_test.sh
15
+ - rvm: 2.5.0 # oldest officially maintained MRI
16
+ - rvm: 2.0.0 # oldest MRI we support
17
+ # - rvm: jruby-9.1.12.0 # experimental
18
+ # allow_failures:
19
+ # - rvm: jruby-9.1.12.0
17
20
 
18
- #matrix:
19
- # allow_failures:
20
- # - rvm: jruby-9.1.12.0
21
+ git:
22
+ depth: 3
data/.yardopts CHANGED
@@ -1,3 +1,3 @@
1
1
  --main doc/yard_readme.rdoc
2
2
  --asset doc/images:images
3
- --file README.md,doc/data_readme.md,data/universal-en.txt
3
+ --file README.md,doc/yard_readme.rdoc,doc/data_readme.md,data/universal-en.txt
@@ -1,5 +1,96 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0] 2020-11-25
4
+
5
+ ### Fixed
6
+
7
+ - several fixes to the solemnity transfer rules:
8
+ - the algorithm was searching for free days only forwards,
9
+ but liturgical law assumes closest free day, even earlier
10
+ - check that two solemnities are not transferred to the same date,
11
+ overwriting one another
12
+ - the special rule on Annunciation from *Normae universales* 60
13
+ implemented
14
+ - fixed bug in computation of the date of Baptism of the Lord if Epiphany
15
+ is transferred to Sunday
16
+ - fixed bug in `Sanctorale#update` preventing more than one `Celebration`
17
+ with nil `#symbol` in a single `Sanctorale`
18
+ - `CelebrationFactory` was setting `Celebration#date` (if not specified)
19
+ to false instead of expected nil (thus breaking type promises)
20
+ - data: `czech-cs.txt`: typo fixed in the feast *symbol* of St. Bartholomew;
21
+ spelling of several feast titles corrected
22
+ - data: `czech-cs.txt`: proof-read against official sources, feasts
23
+ of "BVM, Queen of Angels" and St. Teresa of Calcutta deleted
24
+ (they are not on the calendar of Czech and Moravian dioceses,
25
+ incorrect information was copied from Czech Wikipedia at the time
26
+ of the data file's creation)
27
+ - data: all: Dedication of the Lateran Basilica is feast of the Lord
28
+ (had incorrect rank of a normal feast so far)
29
+ - data: `universal-en.txt`: several inaccuracies concerning liturgical
30
+ colour fixed
31
+
32
+ ### Added
33
+
34
+ - `liturgical_law/`: all documents of liturgical legislation
35
+ containing the liturgical calendar rules (original Latin text)
36
+ in Markdown format, with Ruby code examples proving that
37
+ the rules are implemented correctly;
38
+ the code examples are all executed as part of the gem's test suite
39
+ - `SanctoraleWriter` (contributed by Mike Kasberg @mkasberg)
40
+ - `PerpetualCalendar.new` accepts keyword argument `vespers`
41
+ (cf. `Calendar.new` argument of the same name)
42
+ - `Rank#optional_memorial?`, `#obligatory_memorial?`
43
+ - `AbstractDate#in_year` - more readable alias of `#concretize`
44
+ - `Rank#succ` - (among other things) allows constructing `Range` of `Rank`s
45
+ - `Calendar#transferred`
46
+ - `Temporale::Extensions::DedicationBeforeAllSaints` defining the solemnity
47
+ of Aniversary of Dedication for churches celebrating it on the movable
48
+ date on the last October Sunday
49
+ - `Temporale::Extensions.all` - method listing all Temporale extensions
50
+ defined by the gem
51
+ - `Temporale#each_day`
52
+ - `Temporale::EasterTable` - class handling a simple plaintext format
53
+ for tables of Easter dates
54
+ - `Celebration.new`: new argument `sunday`
55
+ - `SanctoraleLoader`: proper solemnities/feasts/memorials
56
+ can be specified also by adding suffix `p` to the rank code
57
+ (instead of rank priority number used so far),
58
+ similarly suffix `l` can be used to specify proper rank for
59
+ feasts of the Lord
60
+ - data: `universal-1969-la.txt` - historical first version
61
+ of the General Roman Calendar
62
+ - module `Constants` containing all the constants from `Colours`,
63
+ `Seasons` and `Ranks`
64
+
65
+ ### Changed
66
+
67
+ - the gemspec now declares requirement of Ruby >= 2.0
68
+ - `Calendar.new` can be called also without the `year` argument if `Temporale`
69
+ is provided (thus calling `Calendar.new(temporale, sanctorale)`
70
+ instead of `Calendar.new(year, sanctorale, temporale)`)
71
+ - Easter Triduum is now dealt with as a separate `Season`,
72
+ because *Normae universales* 18-21 clearly set the Triduum apart from
73
+ both Lent and Eastertide
74
+ - `Temporale::Extensions::ChristEternalPriest` specifies celebration
75
+ symbol (so far it was nil)
76
+ - `Celebration.new` supports keyword arguments (as an alternative to
77
+ or even in combination with the positional ones)
78
+ - `Temporale`: business logic guaranteeing that `Celebration#sunday?`
79
+ is true also for privileged Sundays (Advent, Lent)
80
+ - `calendariumrom` executable: all subcommands dealing with sanctorale
81
+ data files accept special file name `-` and load sanctorale data
82
+ from stdin in that case
83
+ - `Enum`, `Colours`, `Seasons`, `Ranks` and `Data` changed from classes
84
+ to modules
85
+
86
+ ### Acknowledgements
87
+
88
+ Improvements not affecting the gem's public interface (and thus not listed
89
+ in the changelog) contributed by
90
+
91
+ - Ihor Voloshyn @Snick555
92
+ - Dmitry Zhmurko @zhmurko
93
+
3
94
  ## [0.7.1] 2020-06-28
4
95
 
5
96
  ### Fixed
data/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/calendarium-romanum.svg)](https://badge.fury.io/rb/calendarium-romanum)
5
5
 
6
6
  API documentation:
7
- [master](http://www.rubydoc.info/github/igneus/calendarium-romanum/master)
8
- [0.7.0](http://www.rubydoc.info/gems/calendarium-romanum/0.7.0)
7
+ [0.8.0](http://www.rubydoc.info/gems/calendarium-romanum/0.8.0)
8
+ [0.7.1](http://www.rubydoc.info/gems/calendarium-romanum/0.7.1)
9
9
  [0.6.0](http://www.rubydoc.info/gems/calendarium-romanum/0.6.0)
10
10
  [0.5.0](http://www.rubydoc.info/gems/calendarium-romanum/0.5.0)
11
11
  [0.4.0](http://www.rubydoc.info/gems/calendarium-romanum/0.4.0)
@@ -13,28 +13,47 @@ API documentation:
13
13
  [0.2.0](http://www.rubydoc.info/gems/calendarium-romanum/0.2.0)
14
14
 
15
15
  Ruby gem for
16
- calendar computations according to the Roman Catholic liturgical
17
- calendar as instituted by
18
- [MP Mysterii Paschalis](http://w2.vatican.va/content/paul-vi/en/motu_proprio/documents/hf_p-vi_motu-proprio_19690214_mysterii-paschalis.html) of Paul VI. (AAS 61 (1969), pp. 222-226).
19
- The rules are defined in
20
- *General Norms for the Liturgical Year and the Calendar*
21
- ([English translation][gnlyc]).
22
-
23
- calendarium-romanum aspires to become the most complete
16
+ calendar computations according to the Roman Catholic liturgical calendar as instituted by
17
+ [MP Mysterii Paschalis](http://w2.vatican.va/content/paul-vi/en/motu_proprio/documents/hf_p-vi_motu-proprio_19690214_mysterii-paschalis.html)
18
+ of Paul VI. (AAS 61 (1969), pp. 222-226),
19
+ defined in *General Norms for the Liturgical Year and the Calendar*
20
+ ([English translation][gnlyc])
21
+ and subsequent [documents of liturgical legislation][liturgical_law].
22
+
23
+ `calendarium-romanum` aspires to become the most complete and most accurate
24
24
  FOSS implementation of this calendar system
25
25
  (see [list of implementations available][awesomecc]).
26
26
 
27
27
  ## Features
28
28
 
29
- - [x] liturgical season
30
- - [x] Sundays, temporale feasts
31
- - [x] sanctorale calendars: data format, example data files, their loading
32
- - [x] resolution of precedence of concurrent celebrations
33
- - [x] octave days
34
- - [x] commemorations in the privileged seasons where memorials are suppressed
35
- - [x] transfer of suppressed solemnities
36
- - [x] optional transfer of important solemnities to a Sunday
37
- - [x] additional temporale feasts (Christ the Eternal Priest and similar)
29
+ `calendarium-romanum` is now a **feature-complete** implementation of the abovementioned calendar
30
+ system, capable of generating a complete and (at least mostly) correct Roman Catholic liturgical
31
+ calendar for any year according to the most recent calendar rules and data
32
+ (i.e. today's state of the calendar is used also for years in the past - for historically accurate
33
+ computations see a [related project][crhistorical]).
34
+
35
+ It is **continuously kept up-to-date** with latest developments of the liturgical
36
+ legislation and newly introduced feasts.
37
+
38
+ **Accuracy** is highly valued. Therefore just a very limited set of calendar data
39
+ is bundled in the library, but with a guarantee that a theologian continuously takes care
40
+ of them being up-to-date and correct. Users of the library will usually want to prepare
41
+ and maintain their own data files representing their local calendars.
42
+ (For ready-to-use calendar data without guarantees of correctness
43
+ see a [related repository][data-contrib].)
44
+
45
+ The project's scope is strictly limited to computing **liturgical calendar in a narrow sense.**
46
+ It doesn't provide functionality specific for individual liturgical books, unless it is
47
+ dealt with in general liturgical norms regarding the calendar.
48
+ (Liturgical colours being an exception from this rule, as it is very common to include
49
+ them in all kinds of liturgical calendars.)
50
+ But the library is designed with machine-readability in mind, so that additional layers
51
+ of functionality, implementing book-specific calculations, can be built upon it.
52
+
53
+ Strings are **localized** (using the [i18n][i18n] Ruby gem). Translations to six languages
54
+ (Latin, English, Spanish, French, Italian, Czech)
55
+ are provided. The built-in translations can be both replaced and/or supplemented
56
+ with translations to additional languages without having to modify the gem's code.
38
57
 
39
58
  ## Credits
40
59
 
@@ -46,14 +65,19 @@ See also changelog for list of contributions and their authors.
46
65
 
47
66
  ## License
48
67
 
49
- freely choose between GNU/LGPL 3 and MIT
68
+ dual licensed: freely choose between GNU/LGPL 3 and MIT
50
69
 
51
- ## Project status, Backward compatibility
70
+ ## Project status
52
71
 
53
- The gem's public interface still evolves and each minor release
54
- contains several breaking changes. There is no backward compatibility
55
- between minor versions.
56
- This will continue until release of v1.0.0.
72
+ The library is currently considered feature-complete for release 1.0.0
73
+ and it's public API mostly stabilized.
74
+ Development focuses on reaching higher degree of certainty regarding
75
+ correctness by means of making the test suite more comprehensive and rigorous.
76
+
77
+ ## Backward compatibility
78
+
79
+ The gem's public interface has now been mostly stabilized, but until v1.0.0 release
80
+ there is still no guaranteed backward compatibility between minor versions.
57
81
 
58
82
  When using the gem in your projects, it is recommended to lock
59
83
  the dependency to a particular minor version.
@@ -61,13 +85,13 @@ the dependency to a particular minor version.
61
85
  In your app's Gemfile
62
86
 
63
87
  ```
64
- gem 'calendarium-romanum', '~>0.6.0'
88
+ gem 'calendarium-romanum', '~>0.8.0'
65
89
  ```
66
90
 
67
91
  or in gemspec of your gem
68
92
 
69
93
  ```
70
- spec.add_dependency 'calendarium-romanum', '~>0.6.0'
94
+ spec.add_dependency 'calendarium-romanum', '~>0.8.0'
71
95
  ```
72
96
 
73
97
  ## Usage
@@ -162,11 +186,23 @@ which loads the gem *and* defines the `CR` shortcut for you.
162
186
  Following examples expect the `CR` constant to be defined
163
187
  and reference the `CalendariumRomanum` module.
164
188
 
189
+ Another possible way of saving some typing (if you don't care about
190
+ possible name clashes or polluting current namespace)
191
+ is including `CalendariumRomanum` module in the current module.
192
+ Then `CalendariumRomanum` classes can be referenced unqualified:
193
+
194
+ ```ruby
195
+ include CalendariumRomanum
196
+
197
+ loader = SanctoraleLoader.new
198
+ # etc.
199
+ ```
200
+
165
201
  ### 4. Isn't there an easier way to get sanctorale data?
166
202
 
167
203
  Yes! There are a few data files bundled in the gem.
168
204
  You can explore them by iterating over `CalendariumRomanum::Data.all`.
169
- The more interesting ones are additionally identified by their proper
205
+ Those of general interest are additionally identified by their proper
170
206
  constants, e.g. `CalendariumRomanum::Data::GENERAL_ROMAN_ENGLISH`.
171
207
  Bundled data files can be loaded by a handy shortcut method `#load`:
172
208
 
@@ -204,7 +240,7 @@ a `Calendar` for liturgical year 1999-2000 by calling
204
240
  `Calendar.new(1999)`.
205
241
 
206
242
  We have already seen `Calendar.for_day()`, which takes care
207
- for finding the liturgical year a particular date belongs to
243
+ of finding the liturgical year a particular date belongs to
208
244
  and creating a `Calendar` for this year.
209
245
  But maybe you want to query a calendar without caring about liturgical
210
246
  years altogether, possibly picking days across multiple years.
@@ -283,7 +319,7 @@ proper calendar of any diocese in the Czech Republic.
283
319
 
284
320
  In case you already have sanctorale data in another format,
285
321
  it might be better suited for you to implement your own loading
286
- routine instead of migrating them to our custom format.
322
+ routine instead of transforming them to our custom format.
287
323
  `SanctoraleLoader` is the class to look into for inspiration.
288
324
 
289
325
  The important bit is that for each celebration you
@@ -292,20 +328,59 @@ instance by a call to `Sanctorale#add`, which receives a month,
292
328
  a day (as integers) and a `Celebration`:
293
329
 
294
330
  ```ruby
295
- include CalendariumRomanum
296
- sanctorale = Sanctorale.new
297
- celebration = Celebration.new('Saint John Eudes, priest', Ranks::MEMORIAL_OPTIONAL, Colours::WHITE)
331
+ sanctorale = CR::Sanctorale.new
332
+ celebration = CR::Celebration.new('Saint John Eudes, priest', CR::Ranks::MEMORIAL_OPTIONAL, CR::Colours::WHITE)
298
333
  sanctorale.add 8, 19, celebration
299
334
 
300
335
  date = Date.new(2016, 8, 19)
301
- calendar = Calendar.for_day(date, sanctorale)
336
+ calendar = CR::Calendar.for_day(date, sanctorale)
302
337
 
303
338
  day = calendar[date]
304
339
  day.celebrations # => [#<CalendariumRomanum::Celebration:0x000000010deea8 @title="", @rank=#<struct CalendariumRomanum::Rank priority=3.13, desc="Unprivileged ferials", short_desc="ferial">, @colour=:green>, #<CalendariumRomanum::Celebration:0x000000010fec08 @title="Saint John Eudes, priest", @rank=#<struct CalendariumRomanum::Rank priority=3.12, desc="Optional memorials", short_desc="optional memorial">, @colour=:white>]
305
340
  ```
306
341
 
307
- (Note that this time some typing was saved by *including*
308
- the `CalendariumRomanum` module into the current namespace.)
342
+ ### Proper calendar of a church
343
+
344
+ One common case of preparing custom sanctorale data is
345
+ implementing proper calendar of a church
346
+ (cf. *General Norms for the Liturgical Year and the Calendar* par. 52 c).
347
+ Proper calendar of a church is built by adding to the calendar
348
+ of the diocese (or religious institute) the church'es proper celebration,
349
+ which are usually just two solemnities: anniversary of dedication
350
+ and titular solemnity.
351
+
352
+ Let's say you have calendar of your diocese in sanctorale data file
353
+ `my-diocese.txt`.
354
+ You could copy the file to a new location and add the two proper solemnities,
355
+ but your programmer better self won't allow you to do that.
356
+ What options are left? You can create a new sanctorale file
357
+ with the two proper celebrations and then load it over the calendar
358
+ of the diocese, as explained in [data](/data).
359
+ Or, if you need the calendar just for that single little script
360
+ and don't care about creating data files, you can build the two
361
+ proper solemnities in code:
362
+
363
+ ```ruby
364
+ # here you would load your 'diocese.txt' instead
365
+ diocese = CR::SanctoraleLoader.new.load_from_file 'data/universal-en.txt'
366
+
367
+ dedication = CR::Celebration.new('Anniversary of Dedication of the Parish Church', CR::Ranks::SOLEMNITY_PROPER, CR::Colours::WHITE)
368
+ titular = CR::Celebration.new('Saint Nicholas, Bishop, Titular Solemnity of the Parish Church', CR::Ranks::SOLEMNITY_PROPER, CR::Colours::WHITE)
369
+
370
+ # solution 1 - directly modify the loaded Sanctorale
371
+
372
+ diocese.replace(10, 25, [dedication])
373
+ diocese.replace(12, 6, [titular])
374
+
375
+ # solution 2 - create a new Sanctorale with just the two solemnities,
376
+ # then create a third instance merging contents of the two without modifying them
377
+
378
+ proper_solemnities = CR::Sanctorale.new
379
+ proper_solemnities.replace(10, 25, [dedication])
380
+ proper_solemnities.replace(12, 6, [titular])
381
+
382
+ complete_proper_calendar = CR::SanctoraleFactory.create_layered(diocese, proper_solemnities)
383
+ ```
309
384
 
310
385
  ## I18n, or, how to fix names of temporale feasts
311
386
 
@@ -322,7 +397,7 @@ data.
322
397
 
323
398
  `I18n.locale = :la # or :en, :fr, :it, :cs`
324
399
 
325
- The gem ships with English, Latin, Italian, French and Czech translation.
400
+ The gem ships with English, Latin, Italian, Spanish, French and Czech translation.
326
401
  Contributed translations to other languages are most welcome.
327
402
 
328
403
  ## Transfer of solemnities to a Sunday
@@ -426,7 +501,7 @@ module MyExtension
426
501
 
427
502
  # computes date of the feast;
428
503
  # the year passed as argument is year when the liturgical
429
- # year in question _begun_
504
+ # year in question _began_
430
505
  def self.my_feast_date(year)
431
506
  # the day before Christ the King
432
507
  CR::Temporale::Dates.christ_king(year) - 1
@@ -449,7 +524,7 @@ Some internal details may be worth a mention:
449
524
 
450
525
  On `require 'calendarium-romanum'`, paths of a few translation
451
526
  files bundled in the gem are added to `I18n.config.load_path`.
452
- While otherwise we avoid poluting or modifying the environment
527
+ While otherwise we avoid polluting or modifying the environment
453
528
  outside the gem's own scope, in this case we exceptionally
454
529
  modify global configuration in order to make the internationalization
455
530
  easily and conveniently work.
@@ -472,8 +547,9 @@ from the command line and to check validity of sanctorale data files.
472
547
 
473
548
  ### 1. Query liturgical calendar from the command line
474
549
 
475
- - `calendariumrom query --calendar universal-fr 2007-06-25` queries a non-default (French) calendar for any given date. `--calendar` can be omitted, the default calendar (`universal-en`) is used then. The date can be omitted as well, `calendariumrom` will query the current date, then. Please note that the date has to be in format `YYYY-MM-DD` or `YYYY/MM/DD`. If the day, or even the month is omitted, `query` will query a whole month, or even a whole year. The specified calendar has to be one in the resulting list of the `calendarium calendars` command, or a valid filesystem path.
476
- - `calendariumrom calendars` will list all available data files known to calendarium-romanum.
550
+ - `calendariumrom query` prints calendar entries for today or a specified day, month or year.
551
+ See `calendariumrom help query` for available options and arguments.
552
+ - `calendariumrom calendars` lists data files bundled in `calendarium-romanum`.
477
553
 
478
554
  Tip: `calendariumrom query` is a rather bare-bones calendar querying
479
555
  tool. Check out the [`calrom`][calrom] gem for a more feature-rich
@@ -481,13 +557,16 @@ liturgical calendar for your command line.
481
557
 
482
558
  ### 2. Check sanctorale data files
483
559
 
484
- - `calendariumrom cmp FILE1 FILE2` will load 2 data files from the file system and compare them. If there are any differences in rank or colour of corresponding celebrations, it will output them.
485
- - `calendariumrom errors FILE1, ...` finds errors in a data file. It tries to load it from file system, and if the parser will fail, for whatever reason, it will print out the reason.
560
+ - `calendariumrom cmp FILE1 FILE2` loads two data files and prints any differences between them
561
+ (excepting differences in celebration titles)
562
+ - `calendariumrom errors FILE1, ...` attempts loading a data file (or several of them),
563
+ reports eventual errors
486
564
 
487
565
  ### 3. Help
488
566
 
489
- - `calendariumrom` lists available subcommands
490
- - `calendariumrom help [COMMAND]` outputs a short help for all available subcommands
567
+ - `calendariumrom` lists available subcommands
568
+ - `calendariumrom help [COMMAND]` outputs a short help for all available subcommands
569
+ - `calendariumrom version` prints installed version of the gem
491
570
 
492
571
  ## For Developers
493
572
 
@@ -511,5 +590,9 @@ See also `.travis.yml` for comprehensive tests run on the CI.
511
590
  [gnlyc]: https://www.ewtn.com/catholicism/library/liturgical-year-2193
512
591
  [i18n]: https://github.com/svenfuchs/i18n
513
592
  [translations]: /tree/master/config/locales
593
+ [liturgical_law]: /tree/master/liturgical_law
514
594
  [module-included]: http://ruby-doc.org/core-2.2.2/Module.html#method-i-included
515
595
  [calrom]: https://github.com/calendarium-romanum/calrom
596
+ [crhistorical]: https://github.com/calendarium-romanum/historical
597
+ [data-contrib]: https://github.com/calendarium-romanum/data-contrib
598
+ [i18n]: https://github.com/ruby-i18n/i18n
data/Rakefile CHANGED
@@ -7,3 +7,10 @@ task :spec_all_locales do
7
7
  sh "LOCALE=#{locale} rake spec"
8
8
  end
9
9
  end
10
+
11
+ desc 'Generates calendar dumps for regression tests anew'
12
+ task :regression_refresh do
13
+ 2020.upto(2030).each do |year|
14
+ sh "ruby -Ilib bin/calendariumrom dump #{year} > spec/regression_dumps/#{year}.txt"
15
+ end
16
+ end