oz_holidays 1.2013 → 1.2014
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG +1 -0
- data/javascript/oz_holidays.js +10 -18
- data/lib/oz_holidays.rb +123 -125
- data/oz_holidays.gemspec +3 -12
- data/test/test_all.rb +13 -2
- metadata +5 -7
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDMwNmUyYTJmY2ZkOWMwMTY3OWFmYWM0ZmMxZDRiYTQzYzZlNzA2Yw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjYyOWJhNjg2YWY2ZmNhYjQ2NGRhNjUyN2Y4ODUzZjhmOWNmZjFjMg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjdmMGFlZmExYjRhMTQyZTgxNGY1ZmQ1MmI3YzVjNTQ3NTYzYjkyZTUwNzE3
|
10
|
+
NmVhOTA4MDU1NWYxYWQ3OGNlZjkwMGNmMzU4MDMwNzQ5ZWE5NzU2NTI4MmIz
|
11
|
+
MTU4ODJmZWE1ZDEyOGFmZDIyYTM5Yjg3ZjZhZmUwY2MzMTNiNDg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NGVmNGEzNjY2MGNkYzYzNWM4NzQ3Yjg5NDE4MTJmYTA0NTBmNGIyNTRiNDNh
|
14
|
+
MTZkMmE4ODNlMTcyOWU1NjZlYTJhZDJjZmM1NjVjNmUyNDg2NzIxYmE5MzJh
|
15
|
+
MWE4MmNjMjYwNjk5NjYzZTM1YTM4ODhkNmQzN2M0M2QyOWM3M2I=
|
data/CHANGELOG
CHANGED
data/javascript/oz_holidays.js
CHANGED
@@ -1,19 +1,11 @@
|
|
1
|
-
var oz_holidays = {
|
2
|
-
"
|
3
|
-
"SA":{
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"TAS":{
|
12
|
-
"2011-02-14":"Royal Hobart Regatta","2011-03-14":"Eight Hours Day","2011-04-25":"ANZAC Day","2011-06-13":"Queens Birthday","2012-02-13":"Royal Hobart Regatta","2012-03-12":"Eight Hours Day","2012-06-11":"Queens Birthday","2013-03-11":"Eight Hours Day","2013-06-10":"Queens Birthday"},
|
13
|
-
"NT":{
|
14
|
-
"2011-04-25":"ANZAC Day","2011-05-02":"May Day","2011-06-13":"Queens Birthday","2011-08-01":"Picnic Day","2012-05-07":"May Day","2012-06-11":"Queens Birthday","2012-08-06":"Picnic Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday"},
|
15
|
-
"ACT":{
|
16
|
-
"2011-03-14":"Canberra Day","2011-04-25":"Easter Monday","2011-04-26":"ANZAC Day","2011-06-13":"Queens Birthday","2011-10-03":"Labour Day","2012-03-12":"Canberra Day","2012-06-11":"Queens Birthday","2012-10-01":"Labour Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2013-10-07":"Labour Day"},
|
17
|
-
"National":{
|
18
|
-
"2011-01-03":"New Years Day","2011-01-26":"Australia Day","2011-04-22":"Good Friday","2011-12-26":"Christmas Day","2011-12-27":"Boxing Day","2012-01-02":"New Years Day","2012-01-26":"Australia Day","2012-04-06":"Good Friday","2012-04-09":"Easter Monday","2012-04-25":"ANZAC Day","2012-12-25":"Christmas Day","2012-12-26":"Boxing Day","2013-01-01":"New Years Day","2013-01-28":"Australia Day","2013-03-29":"Good Friday","2013-03-31":"Easter Saturday","2013-04-01":"Easter Monday","2013-04-25":"ANZAC Day","2013-12-25":"Christmas Day","2013-12-26":"Boxing Day"}
|
1
|
+
var oz_holidays = {
|
2
|
+
"QLD":{"2012-05-07":"Labour Day","2012-06-11":"Queens Birthday","2012-08-15":"Royal Qland Show metro","2013-03-30":"Easter Saturday","2013-05-06":"Labour Day","2013-10-07":"Queens Birthday","2014-06-09":"Queens Birthday","2014-10-06":"Labour Day"},
|
3
|
+
"SA":{"2012-03-12":"Adelaide Cup","2012-06-11":"Queens Birthday","2012-10-01":"Labour Day","2013-03-11":"Adelaide Cup","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2013-10-07":"Labour Day","2014-03-10":"Adelaide Cup","2014-06-09":"Queens Birthday","2014-10-07":"Labour Day"},
|
4
|
+
"NSW":{"2012-06-11":"Queens Birthday","2012-10-01":"Labour Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2013-10-07":"Labour Day","2014-06-09":"Queens Birthday","2014-10-06":"Labour Day"},
|
5
|
+
"WA":{"2012-03-05":"Labour Day","2012-06-04":"Foundation Day","2012-10-01":"Queens Birthday","2013-03-04":"Labour Day","2013-06-03":"Foundation Day","2013-09-30":"Queens Birthday","2014-03-03":"Labour Day","2014-06-02":"Foundation Day","2014-09-29":"Queens Birthday"},
|
6
|
+
"VIC":{"2012-03-12":"Labour Day","2012-06-11":"Queens Birthday","2012-11-06":"Melbourne Cup Day","2013-03-11":"Labour Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2013-11-05":"Melbourne Cup Day","2014-03-10":"Labour Day","2014-06-09":"Queens Birthday","2014-11-04":"Melbourne Cup Day"},
|
7
|
+
"TAS":{"2012-02-13":"Royal Hobart Regatta","2012-03-12":"Eight Hours Day","2012-06-11":"Queens Birthday","2013-03-11":"Eight Hours Day","2013-06-10":"Queens Birthday","2014-03-10":"Eight Hours Day","2014-06-09":"Queens Birthday"},
|
8
|
+
"NT":{"2012-05-07":"May Day","2012-06-11":"Queens Birthday","2012-08-06":"Picnic Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2014-05-05":"May Day","2014-08-04":"Picnic Day"},
|
9
|
+
"ACT":{"2012-03-12":"Canberra Day","2012-06-11":"Queens Birthday","2012-10-01":"Labour Day","2013-03-30":"Easter Saturday","2013-06-10":"Queens Birthday","2013-10-07":"Labour Day","2014-03-10":"Canberra Day","2014-06-09":"Queens Birthday","2014-09-29":"Family Day"},
|
10
|
+
"National":{"2012-01-02":"New Years Day","2012-01-26":"Australia Day","2012-04-06":"Good Friday","2012-04-09":"Easter Monday","2012-04-25":"ANZAC Day","2012-12-25":"Christmas Day","2012-12-26":"Boxing Day","2013-01-01":"New Years Day","2013-01-28":"Australia Day","2013-03-29":"Good Friday","2013-04-01":"Easter Monday","2013-04-25":"ANZAC Day","2013-12-25":"Christmas Day","2013-12-26":"Boxing Day","2014-01-01":"New Years Day","2014-01-27":"Australia Day","2014-04-18":"Good Friday","2014-04-21":"Easter Monday","2014-04-25":"ANZAC Day","2014-12-25":"Christmas Day","2014-12-26":"Boxing Day"}
|
19
11
|
}
|
data/lib/oz_holidays.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
require '
|
2
|
+
require 'date'
|
3
3
|
|
4
4
|
class OzHolidays
|
5
5
|
def self.national
|
@@ -15,131 +15,129 @@ class OzHolidays
|
|
15
15
|
def self.to_json
|
16
16
|
by_state.to_json
|
17
17
|
end
|
18
|
+
|
19
|
+
def self.by_date
|
20
|
+
by(:date, :title)
|
21
|
+
end
|
18
22
|
|
23
|
+
def self.by(field1, field2)
|
24
|
+
field3 = (all.first.keys - [field1, field2]).first
|
25
|
+
result = Hash.new {|h,k| h[k] = {} }
|
26
|
+
all.inject(Hash.new {|h,k| h[k] = {} }) do |result, hol|
|
27
|
+
if result[hol[field1]].has_key? hol[field2]
|
28
|
+
result[hol[field1]][hol[field2]] = [result[hol[field1]][hol[field2]], hol[field3]].flatten
|
29
|
+
else
|
30
|
+
result[hol[field1]][hol[field2]] = hol[field3]
|
31
|
+
end
|
32
|
+
result
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
19
36
|
def self.by_state
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
'SA' =>
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
},
|
48
|
-
'NSW' =>
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
},
|
59
|
-
'WA' =>
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
},
|
72
|
-
'VIC' =>
|
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
|
-
},
|
108
|
-
'
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
},
|
121
|
-
'National' =>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
'2011-12-26' => 'Christmas Day',
|
126
|
-
'2011-12-27' => 'Boxing Day',
|
127
|
-
'2012-01-02' => 'New Years Day',
|
128
|
-
'2012-01-26' => 'Australia Day',
|
129
|
-
'2012-04-06' => 'Good Friday',
|
130
|
-
'2012-04-09' => 'Easter Monday',
|
131
|
-
'2012-04-25' => 'ANZAC Day',
|
132
|
-
'2012-12-25' => 'Christmas Day',
|
133
|
-
'2012-12-26' => 'Boxing Day',
|
134
|
-
'2013-01-01' => 'New Years Day',
|
135
|
-
'2013-01-28' => 'Australia Day',
|
136
|
-
'2013-03-29' => 'Good Friday',
|
137
|
-
'2013-03-31' => 'Easter Saturday',
|
138
|
-
'2013-04-01' => 'Easter Monday',
|
139
|
-
'2013-04-25' => 'ANZAC Day',
|
140
|
-
'2013-12-25' => 'Christmas Day',
|
141
|
-
'2013-12-26' => 'Boxing Day'
|
142
|
-
}
|
143
|
-
}
|
37
|
+
by(:state, :date)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.all
|
41
|
+
[
|
42
|
+
{:state => 'QLD', :date => Date.new(2012, 5, 7), :title => 'Labour Day' },
|
43
|
+
{:state => 'QLD', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
44
|
+
{:state => 'QLD', :date => Date.new(2012, 8, 15), :title => 'Royal Qland Show metro' },
|
45
|
+
{:state => 'QLD', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
46
|
+
{:state => 'QLD', :date => Date.new(2013, 5, 6), :title => 'Labour Day' },
|
47
|
+
{:state => 'QLD', :date => Date.new(2013, 10, 7), :title => 'Queens Birthday' },
|
48
|
+
{:state => 'QLD', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
49
|
+
{:state => 'QLD', :date => Date.new(2014, 10, 6), :title => 'Labour Day' },
|
50
|
+
|
51
|
+
{:state => 'SA', :date => Date.new(2012, 3, 12), :title => 'Adelaide Cup' },
|
52
|
+
{:state => 'SA', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
53
|
+
{:state => 'SA', :date => Date.new(2012, 10, 1), :title => 'Labour Day' },
|
54
|
+
{:state => 'SA', :date => Date.new(2013, 3, 11), :title => 'Adelaide Cup' },
|
55
|
+
{:state => 'SA', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
56
|
+
{:state => 'SA', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
57
|
+
{:state => 'SA', :date => Date.new(2013, 10, 7), :title => 'Labour Day' },
|
58
|
+
{:state => 'SA', :date => Date.new(2014, 3, 10), :title => 'Adelaide Cup' },
|
59
|
+
{:state => 'SA', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
60
|
+
{:state => 'SA', :date => Date.new(2014, 10, 7), :title => 'Labour Day' },
|
61
|
+
|
62
|
+
{:state => 'NSW', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
63
|
+
{:state => 'NSW', :date => Date.new(2012, 10, 1), :title => 'Labour Day' },
|
64
|
+
{:state => 'NSW', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
65
|
+
{:state => 'NSW', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
66
|
+
{:state => 'NSW', :date => Date.new(2013, 10, 7), :title => 'Labour Day' },
|
67
|
+
{:state => 'NSW', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
68
|
+
{:state => 'NSW', :date => Date.new(2014, 10, 6), :title => 'Labour Day' },
|
69
|
+
|
70
|
+
{:state => 'WA', :date => Date.new(2012, 3, 5), :title => 'Labour Day' },
|
71
|
+
{:state => 'WA', :date => Date.new(2012, 6, 4), :title => 'Foundation Day' },
|
72
|
+
{:state => 'WA', :date => Date.new(2012, 10, 1), :title => 'Queens Birthday' },
|
73
|
+
{:state => 'WA', :date => Date.new(2013, 3, 4), :title => 'Labour Day' },
|
74
|
+
{:state => 'WA', :date => Date.new(2013, 6, 3), :title => 'Foundation Day' },
|
75
|
+
{:state => 'WA', :date => Date.new(2013, 9, 30), :title => 'Queens Birthday' },
|
76
|
+
{:state => 'WA', :date => Date.new(2014, 3, 3), :title => 'Labour Day' },
|
77
|
+
{:state => 'WA', :date => Date.new(2014, 6, 2), :title => 'Foundation Day' },
|
78
|
+
{:state => 'WA', :date => Date.new(2014, 9, 29), :title => 'Queens Birthday' },
|
79
|
+
|
80
|
+
|
81
|
+
{:state => 'VIC', :date => Date.new(2012, 3, 12), :title => 'Labour Day' },
|
82
|
+
{:state => 'VIC', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
83
|
+
{:state => 'VIC', :date => Date.new(2012, 11, 6), :title => 'Melbourne Cup Day' },
|
84
|
+
{:state => 'VIC', :date => Date.new(2013, 3, 11), :title => 'Labour Day' },
|
85
|
+
{:state => 'VIC', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
86
|
+
{:state => 'VIC', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
87
|
+
{:state => 'VIC', :date => Date.new(2013, 11, 5), :title => 'Melbourne Cup Day' },
|
88
|
+
{:state => 'VIC', :date => Date.new(2014, 3, 10), :title => 'Labour Day' },
|
89
|
+
{:state => 'VIC', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
90
|
+
{:state => 'VIC', :date => Date.new(2014, 11, 4), :title => 'Melbourne Cup Day' },
|
91
|
+
|
92
|
+
{:state => 'TAS', :date => Date.new(2012, 2, 13), :title => 'Royal Hobart Regatta' },
|
93
|
+
{:state => 'TAS', :date => Date.new(2012, 3, 12), :title => 'Eight Hours Day' },
|
94
|
+
{:state => 'TAS', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
95
|
+
{:state => 'TAS', :date => Date.new(2013, 3, 11), :title => 'Eight Hours Day' },
|
96
|
+
{:state => 'TAS', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
97
|
+
{:state => 'TAS', :date => Date.new(2014, 3, 10), :title => 'Eight Hours Day' },
|
98
|
+
{:state => 'TAS', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
99
|
+
|
100
|
+
{:state => 'NT', :date => Date.new(2012, 5, 7), :title => 'May Day' },
|
101
|
+
{:state => 'NT', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
102
|
+
{:state => 'NT', :date => Date.new(2012, 8, 6), :title => 'Picnic Day' },
|
103
|
+
{:state => 'NT', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
104
|
+
{:state => 'NT', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
105
|
+
{:state => 'NT', :date => Date.new(2014, 5, 5), :title => 'May Day' },
|
106
|
+
{:state => 'NT', :date => Date.new(2014, 8, 4), :title => 'Picnic Day' },
|
107
|
+
|
108
|
+
{:state => 'ACT', :date => Date.new(2012, 3, 12), :title => 'Canberra Day' },
|
109
|
+
{:state => 'ACT', :date => Date.new(2012, 6, 11), :title => 'Queens Birthday' },
|
110
|
+
{:state => 'ACT', :date => Date.new(2012, 10, 1), :title => 'Labour Day' },
|
111
|
+
{:state => 'ACT', :date => Date.new(2013, 3, 30), :title => 'Easter Saturday' },
|
112
|
+
{:state => 'ACT', :date => Date.new(2013, 6, 10), :title => 'Queens Birthday' },
|
113
|
+
{:state => 'ACT', :date => Date.new(2013, 10, 7), :title => 'Labour Day' },
|
114
|
+
{:state => 'ACT', :date => Date.new(2014, 3, 10), :title => 'Canberra Day' },
|
115
|
+
{:state => 'ACT', :date => Date.new(2014, 6, 9), :title => 'Queens Birthday' },
|
116
|
+
{:state => 'ACT', :date => Date.new(2014, 9, 29), :title => 'Family Day' },
|
117
|
+
|
118
|
+
{:state => 'National', :date => Date.new(2012, 1, 2), :title => 'New Years Day' },
|
119
|
+
{:state => 'National', :date => Date.new(2012, 1, 26), :title => 'Australia Day' },
|
120
|
+
{:state => 'National', :date => Date.new(2012, 4, 6), :title => 'Good Friday' },
|
121
|
+
{:state => 'National', :date => Date.new(2012, 4, 9), :title => 'Easter Monday' },
|
122
|
+
{:state => 'National', :date => Date.new(2012, 4, 25), :title => 'ANZAC Day' },
|
123
|
+
{:state => 'National', :date => Date.new(2012, 12, 25), :title => 'Christmas Day' },
|
124
|
+
{:state => 'National', :date => Date.new(2012, 12, 26), :title => 'Boxing Day' },
|
125
|
+
{:state => 'National', :date => Date.new(2013, 1, 1), :title => 'New Years Day' },
|
126
|
+
{:state => 'National', :date => Date.new(2013, 1, 28), :title => 'Australia Day' },
|
127
|
+
{:state => 'National', :date => Date.new(2013, 3, 29), :title => 'Good Friday' },
|
128
|
+
{:state => 'National', :date => Date.new(2013, 4, 1), :title => 'Easter Monday' },
|
129
|
+
{:state => 'National', :date => Date.new(2013, 4, 25), :title => 'ANZAC Day' },
|
130
|
+
{:state => 'National', :date => Date.new(2013, 12, 25), :title => 'Christmas Day' },
|
131
|
+
{:state => 'National', :date => Date.new(2013, 12, 26), :title => 'Boxing Day' },
|
132
|
+
{:state => 'National', :date => Date.new(2014, 1, 1), :title => 'New Years Day' },
|
133
|
+
{:state => 'National', :date => Date.new(2014, 1, 27), :title => 'Australia Day' },
|
134
|
+
{:state => 'National', :date => Date.new(2014, 4, 18), :title => 'Good Friday' },
|
135
|
+
{:state => 'National', :date => Date.new(2014, 4, 21), :title => 'Easter Monday' },
|
136
|
+
{:state => 'National', :date => Date.new(2014, 4, 25), :title => 'ANZAC Day' },
|
137
|
+
{:state => 'National', :date => Date.new(2014, 12, 25), :title => 'Christmas Day' },
|
138
|
+
{:state => 'National', :date => Date.new(2014, 12, 26), :title => 'Boxing Day' },
|
139
|
+
|
140
|
+
|
141
|
+
]
|
144
142
|
end
|
145
143
|
end
|
data/oz_holidays.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "oz_holidays"
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.2014"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Andrew Snow"]
|
9
|
-
s.date = "
|
9
|
+
s.date = "2013-07-15"
|
10
10
|
s.description = "Australian Public Holiday database in Ruby & Javascript"
|
11
11
|
s.email = "andrew@modulus.org"
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "README", "lib/oz_holidays.rb"]
|
@@ -15,16 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Oz_holidays", "--main", "README"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = "oz_holidays"
|
18
|
-
s.rubygems_version = "
|
18
|
+
s.rubygems_version = "2.0.3"
|
19
19
|
s.summary = "Australian Public Holiday database in Ruby & Javascript"
|
20
20
|
s.test_files = ["test/test_all.rb"]
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
s.specification_version = 3
|
24
|
-
|
25
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
-
else
|
27
|
-
end
|
28
|
-
else
|
29
|
-
end
|
30
21
|
end
|
data/test/test_all.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require "#{File.dirname(__FILE__)}/../lib/oz_holidays"
|
3
3
|
require 'date'
|
4
|
+
require 'json'
|
4
5
|
|
5
6
|
|
6
7
|
class TestOzHolidays < Test::Unit::TestCase
|
@@ -9,18 +10,28 @@ class TestOzHolidays < Test::Unit::TestCase
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def test_anzac_day
|
12
|
-
assert_not_nil OzHolidays['NSW']["#{Date.today.year}-04-25"]
|
13
|
+
assert_not_nil OzHolidays['NSW'][Date.parse("#{Date.today.year}-04-25")]
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
assert_kind_of Array, OzHolidays.all
|
18
|
+
assert_kind_of Hash, OzHolidays.all.first
|
13
19
|
end
|
14
20
|
|
15
21
|
def test_to_json
|
16
22
|
assert_not_nil OzHolidays.to_json
|
17
23
|
end
|
18
24
|
|
25
|
+
def test_by_date
|
26
|
+
assert_kind_of Hash, OzHolidays.by_date
|
27
|
+
assert_kind_of Hash, OzHolidays.by_date.values.first
|
28
|
+
end
|
29
|
+
|
19
30
|
|
20
31
|
private
|
21
32
|
def find_nyd_hol
|
22
33
|
nyd = Date.parse("#{Date.today.year}-01-01")
|
23
34
|
nyd += 1 while(nyd.wday < 1 || nyd.wday > 5)
|
24
|
-
nyd
|
35
|
+
nyd
|
25
36
|
end
|
26
37
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oz_holidays
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
5
|
-
prerelease:
|
4
|
+
version: '1.2014'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrew Snow
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Australian Public Holiday database in Ruby & Javascript
|
15
14
|
email: andrew@modulus.org
|
@@ -34,6 +33,7 @@ files:
|
|
34
33
|
- oz_holidays.gemspec
|
35
34
|
homepage: http://github.com/andys/oz_holidays
|
36
35
|
licenses: []
|
36
|
+
metadata: {}
|
37
37
|
post_install_message:
|
38
38
|
rdoc_options:
|
39
39
|
- --line-numbers
|
@@ -45,22 +45,20 @@ rdoc_options:
|
|
45
45
|
require_paths:
|
46
46
|
- lib
|
47
47
|
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
-
none: false
|
49
48
|
requirements:
|
50
49
|
- - ! '>='
|
51
50
|
- !ruby/object:Gem::Version
|
52
51
|
version: '0'
|
53
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
53
|
requirements:
|
56
54
|
- - ! '>='
|
57
55
|
- !ruby/object:Gem::Version
|
58
56
|
version: '1.2'
|
59
57
|
requirements: []
|
60
58
|
rubyforge_project: oz_holidays
|
61
|
-
rubygems_version:
|
59
|
+
rubygems_version: 2.0.3
|
62
60
|
signing_key:
|
63
|
-
specification_version:
|
61
|
+
specification_version: 4
|
64
62
|
summary: Australian Public Holiday database in Ruby & Javascript
|
65
63
|
test_files:
|
66
64
|
- test/test_all.rb
|