holidays 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG +7 -0
- data/{README → README.rdoc} +36 -39
- data/data/SYNTAX +1 -1
- data/data/au.yaml +110 -105
- data/data/build_defs.rb +4 -3
- data/data/ca.yaml +140 -140
- data/data/cz.yaml +68 -0
- data/data/de.yaml +12 -14
- data/data/dk.yaml +1 -1
- data/data/es.yaml +1 -1
- data/data/fr.yaml +1 -1
- data/data/gb.yaml +1 -1
- data/data/ie.yaml +1 -1
- data/data/index.yaml +7 -2
- data/data/is.yaml +1 -1
- data/data/it.yaml +1 -1
- data/data/mx.yaml +1 -1
- data/data/nl.yaml +1 -1
- data/data/no.yaml +82 -0
- data/data/nyse.yaml +1 -1
- data/data/nz.yaml +141 -0
- data/data/pt.yaml +1 -1
- data/data/se.yaml +1 -1
- data/data/united_nations.yaml +188 -188
- data/data/ups.yaml +55 -55
- data/data/us.yaml +80 -80
- data/data/za.yaml +1 -1
- data/holidays.gemspec +155 -0
- data/lib/holidays.rb +424 -403
- data/lib/holidays/MANIFEST +28 -25
- data/lib/holidays/au.rb +43 -41
- data/lib/holidays/ca.rb +69 -68
- data/lib/holidays/cz.rb +36 -0
- data/lib/holidays/de.rb +51 -52
- data/lib/holidays/dk.rb +48 -47
- data/lib/holidays/es.rb +53 -52
- data/lib/holidays/europe.rb +236 -215
- data/lib/holidays/fr.rb +37 -36
- data/lib/holidays/gb.rb +41 -40
- data/lib/holidays/ie.rb +33 -32
- data/lib/holidays/is.rb +62 -61
- data/lib/holidays/it.rb +36 -35
- data/lib/holidays/mx.rb +52 -51
- data/lib/holidays/nl.rb +37 -36
- data/lib/holidays/no.rb +40 -0
- data/lib/holidays/north_america.rb +108 -107
- data/lib/holidays/nyse.rb +33 -32
- data/lib/holidays/nz.rb +69 -0
- data/lib/holidays/pt.rb +38 -52
- data/lib/holidays/scandinavia.rb +124 -114
- data/lib/holidays/se.rb +53 -52
- data/lib/holidays/united_nations.rb +25 -24
- data/lib/holidays/ups.rb +32 -31
- data/lib/holidays/us.rb +49 -48
- data/lib/holidays/za.rb +36 -35
- data/rakefile.rb +105 -113
- data/test/defs/test_defs_au.rb +36 -36
- data/test/defs/test_defs_ca.rb +29 -29
- data/test/defs/test_defs_cz.rb +26 -0
- data/test/defs/test_defs_de.rb +51 -46
- data/test/defs/test_defs_dk.rb +30 -30
- data/test/defs/test_defs_es.rb +57 -57
- data/test/defs/test_defs_europe.rb +280 -240
- data/test/defs/test_defs_fr.rb +26 -26
- data/test/defs/test_defs_gb.rb +36 -36
- data/test/defs/test_defs_ie.rb +21 -21
- data/test/defs/test_defs_is.rb +33 -33
- data/test/defs/test_defs_it.rb +25 -25
- data/test/defs/test_defs_mx.rb +22 -22
- data/test/defs/test_defs_nl.rb +24 -24
- data/test/defs/test_defs_no.rb +29 -0
- data/test/defs/test_defs_north_america.rb +54 -54
- data/test/defs/test_defs_nyse.rb +22 -22
- data/test/defs/test_defs_nz.rb +22 -0
- data/test/defs/test_defs_pt.rb +32 -32
- data/test/defs/test_defs_scandinavia.rb +94 -75
- data/test/defs/test_defs_se.rb +32 -32
- data/test/defs/test_defs_ups.rb +21 -21
- data/test/defs/test_defs_us.rb +23 -23
- data/test/defs/test_defs_za.rb +25 -25
- data/test/test_date.rb +123 -0
- data/test/test_helper.rb +22 -0
- data/test/test_holidays.rb +128 -0
- data/test/test_multiple_regions.rb +24 -0
- metadata +126 -73
data/lib/holidays/ups.rb
CHANGED
@@ -1,31 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/ups.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/ups'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module UPS # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:ups]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:ups]}],
|
19
|
+
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:ups]}],
|
20
|
+
7 => [{:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:ups]}],
|
21
|
+
9 => [{:wday => 1, :week => 1, :name => "Labor Day", :regions => [:ups]}],
|
22
|
+
11 => [{:wday => 4, :week => 4, :name => "Thanksgiving", :regions => [:ups]},
|
23
|
+
{:wday => 5, :week => 4, :name => "Day After Thanksgiving", :regions => [:ups]}],
|
24
|
+
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:ups]},
|
25
|
+
{:mday => 31, :name => "New Year's Eve", :regions => [:ups]}]
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
Holidays.merge_defs(Holidays::UPS::DEFINED_REGIONS, Holidays::UPS::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/us.rb
CHANGED
@@ -1,48 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
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
|
-
|
47
|
-
|
48
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/us.yaml, data/north_america_informal.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/us'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module US # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:us, :us_dc, :ca]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
|
19
|
+
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:us]},
|
20
|
+
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
|
21
|
+
{:function => lambda { |year| Holidays.us_inauguration_day(year) }, :function_id => "us_inauguration_day(year)", :name => "Inauguration Day", :regions => [:us_dc]}],
|
22
|
+
2 => [{:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
|
23
|
+
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
|
24
|
+
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
|
25
|
+
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:us]},
|
26
|
+
{:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
|
27
|
+
7 => [{:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:us]}],
|
28
|
+
9 => [{:wday => 1, :week => 1, :name => "Labor Day", :regions => [:us]}],
|
29
|
+
10 => [{:wday => 1, :week => 2, :name => "Columbus Day", :regions => [:us]},
|
30
|
+
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
31
|
+
11 => [{:mday => 11, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Veterans Day", :regions => [:us]},
|
32
|
+
{:wday => 4, :week => 4, :name => "Thanksgiving", :regions => [:us]}],
|
33
|
+
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:us]}],
|
34
|
+
3 => [{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
|
35
|
+
4 => [{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
|
36
|
+
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# January 20, every fourth year, following Presidential election
|
41
|
+
def self.us_inauguration_day(year)
|
42
|
+
year % 4 == 1 ? 20 : nil
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
Holidays.merge_defs(Holidays::US::DEFINED_REGIONS, Holidays::US::HOLIDAYS_BY_MONTH)
|
data/lib/holidays/za.rb
CHANGED
@@ -1,35 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# require 'holidays
|
11
|
-
#
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:za]},
|
19
|
-
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Family Day", :regions => [:za]}],
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
8 => [{:mday => 9, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "National Women's Day", :regions => [:za]}],
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module Holidays
|
3
|
+
# This file is generated by the Ruby Holiday gem.
|
4
|
+
#
|
5
|
+
# Definitions loaded: data/za.yaml
|
6
|
+
#
|
7
|
+
# To use the definitions in this file, load them right after you load the
|
8
|
+
# Holiday gem:
|
9
|
+
#
|
10
|
+
# require 'holidays'
|
11
|
+
# require 'holidays/za'
|
12
|
+
#
|
13
|
+
# More definitions are available at http://code.dunae.ca/holidays.
|
14
|
+
module ZA # :nodoc:
|
15
|
+
DEFINED_REGIONS = [:za]
|
16
|
+
|
17
|
+
HOLIDAYS_BY_MONTH = {
|
18
|
+
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:za]},
|
19
|
+
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Family Day", :regions => [:za]}],
|
20
|
+
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "New Year's Day", :regions => [:za]}],
|
21
|
+
3 => [{:mday => 21, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Human Rights Day", :regions => [:za]}],
|
22
|
+
4 => [{:mday => 27, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Freedom Day", :regions => [:za]}],
|
23
|
+
5 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Workers Day", :regions => [:za]}],
|
24
|
+
6 => [{:mday => 16, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Youth Day", :regions => [:za]}],
|
25
|
+
8 => [{:mday => 9, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "National Women's Day", :regions => [:za]}],
|
26
|
+
9 => [{:mday => 24, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Heritage Day", :regions => [:za]}],
|
27
|
+
12 => [{:mday => 16, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Day of Reconciliation", :regions => [:za]},
|
28
|
+
{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "Christmas Day", :regions => [:za]},
|
29
|
+
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Day of Goodwill", :regions => [:za]}]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
Holidays.merge_defs(Holidays::ZA::DEFINED_REGIONS, Holidays::ZA::HOLIDAYS_BY_MONTH)
|
data/rakefile.rb
CHANGED
@@ -1,113 +1,105 @@
|
|
1
|
-
|
2
|
-
require 'rake
|
3
|
-
require 'rake/
|
4
|
-
require 'rake/
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
t.
|
18
|
-
t.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
t.
|
25
|
-
t.
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
rdoc.
|
35
|
-
rdoc.
|
36
|
-
rdoc.options << '--
|
37
|
-
|
38
|
-
rdoc.rdoc_files.include('README')
|
39
|
-
rdoc.rdoc_files.include('data/SYNTAX')
|
40
|
-
rdoc.rdoc_files.include('lib/holidays/MANIFEST')
|
41
|
-
rdoc.rdoc_files.include('REFERENCES')
|
42
|
-
rdoc.rdoc_files.include('CHANGELOG')
|
43
|
-
rdoc.rdoc_files.include('LICENSE')
|
44
|
-
rdoc.rdoc_files.include('lib/*.rb')
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
EOH
|
108
|
-
FileList.new('lib/holidays/*.rb').each do |str|
|
109
|
-
file.puts('* ' + str.gsub(/^lib\/|\.rb$/, ''))
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
1
|
+
$:.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/gempackagetask'
|
6
|
+
require 'yaml'
|
7
|
+
require 'fileutils'
|
8
|
+
require 'holidays'
|
9
|
+
require File.expand_path('data/build_defs')
|
10
|
+
|
11
|
+
desc 'Run all tests'
|
12
|
+
task :test => ["test:lib", "test:defs"]
|
13
|
+
|
14
|
+
namespace :test do
|
15
|
+
desc 'Run the unit tests.'
|
16
|
+
Rake::TestTask.new(:defs) do |t|
|
17
|
+
t.libs << 'lib'
|
18
|
+
t.test_files = FileList['test/defs/test*.rb'].exclude('test_helper.rb')
|
19
|
+
t.verbose = false
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Run the definition tests.'
|
23
|
+
Rake::TestTask.new(:lib) do |t|
|
24
|
+
t.libs << 'lib'
|
25
|
+
t.test_files = FileList['test/test*.rb'].exclude('test_helper.rb')
|
26
|
+
t.verbose = false
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
task :doc => ["defs:manifest", :rdoc]
|
31
|
+
|
32
|
+
desc 'Generate documentation.'
|
33
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
34
|
+
rdoc.rdoc_dir = 'doc'
|
35
|
+
rdoc.title = 'Ruby Holidays Gem'
|
36
|
+
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
|
37
|
+
rdoc.options << '--charset' << 'utf-8'
|
38
|
+
rdoc.rdoc_files.include('README.rdoc')
|
39
|
+
rdoc.rdoc_files.include('data/SYNTAX')
|
40
|
+
rdoc.rdoc_files.include('lib/holidays/MANIFEST')
|
41
|
+
rdoc.rdoc_files.include('REFERENCES')
|
42
|
+
rdoc.rdoc_files.include('CHANGELOG')
|
43
|
+
rdoc.rdoc_files.include('LICENSE')
|
44
|
+
rdoc.rdoc_files.include('lib/*.rb')
|
45
|
+
end
|
46
|
+
|
47
|
+
desc 'Definition file tasks'
|
48
|
+
namespace :defs do
|
49
|
+
DATA_PATH = 'data'
|
50
|
+
|
51
|
+
desc 'Build holiday definition files'
|
52
|
+
task :build_all do
|
53
|
+
# load the index
|
54
|
+
def_index = YAML.load_file("#{DATA_PATH}/index.yaml")
|
55
|
+
|
56
|
+
# create a dir for the generated tests
|
57
|
+
FileUtils.mkdir_p('test/defs')
|
58
|
+
|
59
|
+
def_index['defs'].each do |region, files|
|
60
|
+
puts "Building #{region} definition module:"
|
61
|
+
files = files.collect { |f| "#{DATA_PATH}/#{f}" }
|
62
|
+
files.uniq!
|
63
|
+
|
64
|
+
module_src, test_src = parse_holiday_defs(region, files)
|
65
|
+
File.open("lib/holidays/#{region.downcase.to_s}.rb","w") do |file|
|
66
|
+
file.puts module_src
|
67
|
+
end
|
68
|
+
unless test_src.empty?
|
69
|
+
File.open("test/defs/test_defs_#{region.downcase.to_s}.rb","w") do |file|
|
70
|
+
file.puts test_src
|
71
|
+
end
|
72
|
+
end
|
73
|
+
puts "Done.\n\n"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
desc 'Build the definition manifest.'
|
78
|
+
task :manifest do
|
79
|
+
File.open("lib/holidays/MANIFEST","w") do |file|
|
80
|
+
file.puts <<-EOH
|
81
|
+
==== Regional definitions
|
82
|
+
The following definition files are included in this installation:
|
83
|
+
|
84
|
+
EOH
|
85
|
+
FileList.new('lib/holidays/*.rb').each do |str|
|
86
|
+
file.puts('* ' + str.gsub(/^lib\/|\.rb$/, ''))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
begin
|
93
|
+
require 'jeweler'
|
94
|
+
Jeweler::Tasks.new do |gemspec|
|
95
|
+
gemspec.name = "holidays"
|
96
|
+
gemspec.summary = "A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!"
|
97
|
+
gemspec.description = "A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!"
|
98
|
+
gemspec.email = "code@dunae.ca"
|
99
|
+
gemspec.homepage = "https://github.com/alexdunae/holidays"
|
100
|
+
gemspec.version = Holidays::VERSION
|
101
|
+
gemspec.authors = ["Alex Dunae", "Rowan Crawford"]
|
102
|
+
end
|
103
|
+
rescue LoadError
|
104
|
+
puts "Jeweler not available. Install it with: gem install jeweler"
|
105
|
+
end
|