-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.rb
46 lines (43 loc) · 968 Bytes
/
run.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require_relative 'holiday'
regions = {
deutschland:
{
de: 'Gesamt',
de_sn: 'Sachsen',
de_bb: 'Brandenburg',
de_bw: 'Baden-Württemberg',
de_by: 'Bayern',
de_he: 'Hessen',
de_mv: 'Mecklenburg-Vorpommern',
de_nw: 'Nordrhein-Westfalen',
de_rp: 'Rheinland-Pfalz',
de_sl: 'Saarland',
de_st: 'Sachsen-Anhalt',
de_th: 'Thürigen'
},
frankreich:
{
fr: 'Gesamt'
},
england:
{
gb: 'Gesamt'
},
america:
{
us: 'Gesamt'
}
}
# as the library returns informal holidays as well, we need to exclude some
excluded_days = [
'Heilig Abend', 'Weiberfastnacht', 'Rosenmontag', 'Aschermittwoch', # de*
"April Fool's Day", "Valentine's Day", "Father's Day" # us
]
Files.delete(:archives)
ARGV.each do |args|
result = TemplateFileGenerator.run(year: args.to_i, regions: regions, excluded_days: excluded_days)
result.each do |output|
output.to_console # optional
output.to_archive
end
end