business_calendar 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/holidays.yml +13 -0
- data/lib/business_calendar/version.rb +1 -1
- data/spec/acceptance_br_spec.rb +37 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d352073cba3980654ef7cbcd0acbbd1bc0e080b2
|
4
|
+
data.tar.gz: 6f7462eed85e8198eac0508cfafd96fa3c8e0289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 173699885a116dbffea3fb7556c7f64cc22b03146528b1cb9cbcbc18918e412f4a73e656f69408afa9524f42db664be61783ad1800be311343954a9e4adae3b8
|
7
|
+
data.tar.gz: f4eaef2695e82cc87fe6d4309bb4fef56d1bf3e3dbf8da9c7f0be2ae342b0e75d6bb6b308a8985fbe50abfac634f895bc0d7c4d50c1d7bd50b6832e4455c7cc6
|
data/data/holidays.yml
CHANGED
@@ -99,3 +99,16 @@ CN:
|
|
99
99
|
- '2015-10-07'
|
100
100
|
additions_only: true
|
101
101
|
holiday_names: [] # Not needed cause all holidays are via manual +additions+
|
102
|
+
|
103
|
+
BR:
|
104
|
+
regions:
|
105
|
+
- 'br'
|
106
|
+
holiday_names:
|
107
|
+
- "Dia da Confraternização Universal"
|
108
|
+
- "Dia de Tiradentes"
|
109
|
+
- "Dia do Trabalho"
|
110
|
+
- "Proclamação da Independência"
|
111
|
+
- "Dia de Nossa Senhora Aparecida"
|
112
|
+
- "Dia de Finados"
|
113
|
+
- "Proclamação da República"
|
114
|
+
- "Natal"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "BR bank holidays" do
|
4
|
+
%w(
|
5
|
+
2014-01-01
|
6
|
+
2014-04-21
|
7
|
+
2014-05-01
|
8
|
+
2014-09-07
|
9
|
+
2014-10-12
|
10
|
+
2014-11-02
|
11
|
+
2014-11-15
|
12
|
+
2014-12-25
|
13
|
+
2015-01-01
|
14
|
+
2015-04-21
|
15
|
+
2015-05-01
|
16
|
+
2015-09-07
|
17
|
+
2015-10-12
|
18
|
+
2015-11-02
|
19
|
+
2015-11-15
|
20
|
+
2015-12-25
|
21
|
+
).map { |x| Date.parse x }.each do |expected_holiday|
|
22
|
+
it "treats #{expected_holiday} as a holiday" do
|
23
|
+
BusinessCalendar.for(:BR).is_holiday?(expected_holiday).should be_true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Carnival days
|
28
|
+
%w(
|
29
|
+
2014-02-28
|
30
|
+
2014-03-03
|
31
|
+
2014-03-04
|
32
|
+
).map { |x| Date.parse x }.each do |date|
|
33
|
+
it "treats #{date} as not a holiday" do
|
34
|
+
BusinessCalendar.for(:BR).is_holiday?(date).should be_false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Nubel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: holidays
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/business_calendar/calendar.rb
|
101
101
|
- lib/business_calendar/holiday_determiner.rb
|
102
102
|
- lib/business_calendar/version.rb
|
103
|
+
- spec/acceptance_br_spec.rb
|
103
104
|
- spec/acceptance_cn_spec.rb
|
104
105
|
- spec/acceptance_gb_spec.rb
|
105
106
|
- spec/acceptance_us_spec.rb
|
@@ -131,6 +132,7 @@ signing_key:
|
|
131
132
|
specification_version: 4
|
132
133
|
summary: Country-aware business-date logic and handling.
|
133
134
|
test_files:
|
135
|
+
- spec/acceptance_br_spec.rb
|
134
136
|
- spec/acceptance_cn_spec.rb
|
135
137
|
- spec/acceptance_gb_spec.rb
|
136
138
|
- spec/acceptance_us_spec.rb
|