us_bank_holidays 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2c3a4c8155f725d440890a1d187c38596f34b326
4
+ data.tar.gz: 239f7ae539a79fce66e8eb97fd8d78e110bea7d2
5
+ SHA512:
6
+ metadata.gz: e5631bf04812d8a388c88a0a5e834f7dfb8d9eadbd44baa9308ceb5aac6c74030545f2ce276f45c63a27e3c2daeb5afabdf510562f27d7796dd0ea4c81a7b0f1
7
+ data.tar.gz: 7f2af15f67b235524fb4a818c33aa5fdadc85b964495a56602e973190ed91ae35012560ffeb5c45572ba9f8c027ab1ef0d7e74349ab3449340e3091e9fa1f6bf
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in us_bank_holidays.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Arthur Shagall
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # UsBankHolidays
2
+
3
+ Patches `Date` to make working with US bank holidays easier
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'us_bank_holidays'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install us_bank_holidays
18
+
19
+ ## Usage
20
+
21
+ First, load the gem.
22
+
23
+ ```ruby
24
+ require 'us_bank_holidays'
25
+ ```
26
+
27
+ This adds the following features to dates.
28
+
29
+ ```ruby
30
+ date = Date.new(2014, 1, 3) # Friday, January 3, 2014
31
+ date.bank_holiday? # Returns false
32
+ date.weekend? # Returns false
33
+ date.next_banking_day # Returns Monday, January 6, 2014
34
+
35
+ Date.new(2014, 1, 16).add_banking_days(2) # Returns Tuesday, January 21, 2014
36
+ ```
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Make sure all your changes are covered by tests
44
+ 5. Push to the branch (`git push origin my-new-feature`)
45
+ 6. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'bundler/gem_tasks'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1,67 @@
1
+ require 'date'
2
+
3
+ require 'us_bank_holidays/version'
4
+ require 'us_bank_holidays/holiday_year'
5
+ require 'us_bank_holidays/month'
6
+
7
+ module UsBankHolidays
8
+
9
+ def self.weekend?(date)
10
+ date.sunday? || date.saturday?
11
+ end
12
+
13
+ def self.bank_holiday?(date)
14
+ weekend?(date) ||
15
+ ::UsBankHolidays::HolidayYear.new(date.year).bank_holidays.include?(date)
16
+ end
17
+
18
+ def self.next_banking_day(date)
19
+ if (next_date = date + 1).bank_holiday?
20
+ next_banking_day(next_date)
21
+ else
22
+ next_date
23
+ end
24
+ end
25
+
26
+ def self.previous_banking_day(date)
27
+ if (previous_date = date - 1).bank_holiday?
28
+ previous_banking_day(previous_date)
29
+ else
30
+ previous_date
31
+ end
32
+ end
33
+
34
+ module DateMethods
35
+
36
+ def weekend?
37
+ ::UsBankHolidays.weekend? self
38
+ end
39
+
40
+ def bank_holiday?
41
+ ::UsBankHolidays.bank_holiday? self
42
+ end
43
+
44
+ def next_banking_day
45
+ ::UsBankHolidays.next_banking_day self
46
+ end
47
+
48
+ def previous_banking_day
49
+ ::UsBankHolidays.previous_banking_day self
50
+ end
51
+
52
+ def add_banking_days(days)
53
+ day = self
54
+ if days > 0
55
+ days.times { day = day.next_banking_day }
56
+ elsif days < 0
57
+ (-days).times { day = day.previous_banking_day }
58
+ end
59
+ day
60
+ end
61
+ end
62
+
63
+ end
64
+
65
+ ::Date.class_eval do
66
+ include ::UsBankHolidays::DateMethods
67
+ end
@@ -0,0 +1,86 @@
1
+ module UsBankHolidays
2
+
3
+ class HolidayYear
4
+
5
+ attr_reader :year,
6
+ :new_years_day,
7
+ :mlk_day,
8
+ :washingtons_birthday,
9
+ :memorial_day,
10
+ :independence_day,
11
+ :labor_day,
12
+ :columbus_day,
13
+ :veterans_day,
14
+ :thanksgiving,
15
+ :christmas
16
+
17
+ def initialize(year)
18
+ @year = year
19
+
20
+ # First of the year, rolls either forward or back.
21
+ @new_years_day = roll_nominal(Date.new(year, 1, 1))
22
+
23
+ # Third Monday of January
24
+ @mlk_day = ::UsBankHolidays::Month.new(year, 1).mondays[2]
25
+
26
+ # Third Monday of February
27
+ @washingtons_birthday = ::UsBankHolidays::Month.new(year, 2).mondays[2]
28
+
29
+ # Last Monday of May
30
+ @memorial_day = ::UsBankHolidays::Month.new(year, 5).mondays.last
31
+
32
+ # 4'th of July
33
+ @independence_day = roll_nominal(Date.new(year, 7, 4))
34
+
35
+ # First Monday of September
36
+ @labor_day = ::UsBankHolidays::Month.new(year, 9).mondays.first
37
+
38
+ # Second Monday of October
39
+ @columbus_day = ::UsBankHolidays::Month.new(year, 10).mondays[1]
40
+
41
+ # November 11
42
+ @veterans_day = roll_nominal(Date.new(year, 11, 11))
43
+
44
+ # Fourth Thursday of November
45
+ @thanksgiving = ::UsBankHolidays::Month.new(year, 11).thursdays[3]
46
+
47
+ # December 25
48
+ @christmas = roll_nominal(Date.new(year, 12, 25))
49
+
50
+ end
51
+
52
+ def bank_holidays
53
+ @bank_holidays ||= begin
54
+ holidays = [ new_years_day,
55
+ mlk_day,
56
+ washingtons_birthday,
57
+ memorial_day,
58
+ independence_day,
59
+ labor_day,
60
+ columbus_day,
61
+ veterans_day,
62
+ thanksgiving,
63
+ christmas
64
+ ]
65
+ if Date.new(year + 1, 1, 1).saturday?
66
+ holidays << Date.new(year, 12, 31)
67
+ end
68
+ holidays.freeze
69
+ end
70
+ end
71
+
72
+ private
73
+
74
+ def roll_nominal(nominal)
75
+ if nominal.saturday?
76
+ nominal - 1
77
+ elsif nominal.sunday?
78
+ nominal + 1
79
+ else
80
+ nominal
81
+ end
82
+ end
83
+
84
+ end
85
+
86
+ end
@@ -0,0 +1,92 @@
1
+ module UsBankHolidays
2
+
3
+ # Utility class to make it easier to work with a particular month
4
+ class Month
5
+
6
+ attr_reader :year, :month
7
+
8
+ def initialize(year, month)
9
+ if month < 1 || month > 12
10
+ raise ArgumentError, "Month is out of range, must be between 1 and 12, got #{month}"
11
+ end
12
+ @month = month
13
+ @year = year
14
+ init_month
15
+ end
16
+
17
+ def to_s
18
+ @to_s ||= begin
19
+ wks = @weeks.map { |w|
20
+ w.map { |d|
21
+ if d.nil?
22
+ ' '
23
+ elsif d.day < 10
24
+ " #{d.day}"
25
+ else
26
+ "#{d.day}"
27
+ end
28
+ }.join(' ')
29
+ }.join("\n")
30
+ "Su Mo Tu We Th Fr Sa\n#{wks}\n"
31
+ end
32
+ end
33
+
34
+ {
35
+ :sundays => 0,
36
+ :mondays => 1,
37
+ :tuesdays => 2,
38
+ :wednesdays => 3,
39
+ :thursdays => 4,
40
+ :fridays => 5,
41
+ :saturdays => 6
42
+ }.each do |day, index|
43
+
44
+ define_method(day) do
45
+ @weeks.map { |w|
46
+ w[index]
47
+ }.compact
48
+ end
49
+
50
+ end
51
+
52
+ private
53
+
54
+ def init_month
55
+ @weeks = []
56
+ current_date = Date.new(year, month, 1)
57
+ week = init_first_week(current_date)
58
+ while current_date.month == month
59
+ week << current_date
60
+ current_date += 1
61
+ if week.size == 7 || current_date.month != month
62
+ @weeks << week.freeze
63
+ unless current_date.month > month
64
+ week = []
65
+ end
66
+ end
67
+ end
68
+ @weeks.freeze
69
+ end
70
+
71
+ def init_first_week(start_date)
72
+ case start_date.wday
73
+ when 0
74
+ []
75
+ when 1
76
+ [nil]
77
+ when 2
78
+ [nil, nil]
79
+ when 3
80
+ [nil, nil, nil]
81
+ when 4
82
+ [nil, nil, nil, nil]
83
+ when 5
84
+ [nil, nil, nil, nil, nil]
85
+ when 6
86
+ [nil, nil, nil, nil, nil, nil]
87
+ end
88
+ end
89
+
90
+ end
91
+
92
+ end
@@ -0,0 +1,3 @@
1
+ module UsBankHolidays
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe UsBankHolidays::HolidayYear do
4
+
5
+ it 'should determine bank holidays' do
6
+ UsBankHolidays::HolidayYear.new(2017).bank_holidays.should == [
7
+ '2017-01-02', #New Year’s Day
8
+ '2017-01-16', #Birthday of Martin Luther King, Jr.
9
+ '2017-02-20', #Washington’s Birthday
10
+ '2017-05-29', #Memorial Day
11
+ '2017-07-04', #Independence Day
12
+ '2017-09-04', #Labor Day
13
+ '2017-10-09', #Columbus Day
14
+ '2017-11-10', #Veterans Day
15
+ '2017-11-23', #Thanksgiving Day
16
+ '2017-12-25' #Christmas Day
17
+ ].map{|d| Date.parse(d) }
18
+ end
19
+
20
+ it 'should declare Dec. 31 a bank holiday if it falls on a Friday' do
21
+ UsBankHolidays::HolidayYear.new(2021).bank_holidays.last.should == Date.new(2021, 12, 31)
22
+ end
23
+ end
@@ -0,0 +1,95 @@
1
+ require 'spec_helper'
2
+
3
+ describe UsBankHolidays::Month do
4
+ let(:january) { UsBankHolidays::Month.new(2014, 1) }
5
+
6
+ it 'should record the correct month' do
7
+ january.month.should == 1
8
+ end
9
+
10
+ it 'should record the correct year' do
11
+ january.year.should == 2014
12
+ end
13
+
14
+ it 'should raise an error if the month is out of range' do
15
+ [0,13].each { |m|
16
+ expect {
17
+ UsBankHolidays::Month.new(2014, m)
18
+ }.to raise_error(ArgumentError)
19
+ }
20
+ end
21
+
22
+ describe '.to_s' do
23
+
24
+ let(:january_str) {
25
+ <<-JAN
26
+ Su Mo Tu We Th Fr Sa
27
+ 1 2 3 4
28
+ 5 6 7 8 9 10 11
29
+ 12 13 14 15 16 17 18
30
+ 19 20 21 22 23 24 25
31
+ 26 27 28 29 30 31
32
+ JAN
33
+ }
34
+
35
+ let(:february_str) {
36
+ <<-FEB
37
+ Su Mo Tu We Th Fr Sa
38
+ 1 2 3 4 5 6 7
39
+ 8 9 10 11 12 13 14
40
+ 15 16 17 18 19 20 21
41
+ 22 23 24 25 26 27 28
42
+ FEB
43
+ }
44
+
45
+ let(:august_str) {
46
+ <<-AUG
47
+ Su Mo Tu We Th Fr Sa
48
+ 1 2
49
+ 3 4 5 6 7 8 9
50
+ 10 11 12 13 14 15 16
51
+ 17 18 19 20 21 22 23
52
+ 24 25 26 27 28 29 30
53
+ 31
54
+ AUG
55
+ }
56
+
57
+ let(:december_str) {
58
+ <<-DEC
59
+ Su Mo Tu We Th Fr Sa
60
+ 1 2 3 4 5
61
+ 6 7 8 9 10 11 12
62
+ 13 14 15 16 17 18 19
63
+ 20 21 22 23 24 25 26
64
+ 27 28 29 30 31
65
+ DEC
66
+ }
67
+
68
+ it 'should convert the month to a string representation' do
69
+ UsBankHolidays::Month.new(2014, 1).to_s.should == january_str
70
+ UsBankHolidays::Month.new(2015, 2).to_s.should == february_str
71
+ UsBankHolidays::Month.new(2014, 8).to_s.should == august_str
72
+ UsBankHolidays::Month.new(2015, 12).to_s.should == december_str
73
+ end
74
+ end
75
+
76
+ context 'days of week' do
77
+ {
78
+ :sundays => [5, 12, 19, 26],
79
+ :mondays => [6, 13, 20, 27],
80
+ :tuesdays => [7, 14, 21, 28],
81
+ :wednesdays => [1, 8, 15, 22, 29],
82
+ :thursdays => [2, 9, 16, 23, 30],
83
+ :fridays => [3, 10, 17, 24, 31],
84
+ :saturdays => [4, 11, 18, 25]
85
+ }.each do |method, days|
86
+
87
+ describe ".#{method}" do
88
+ it 'should gather up the required days and compact out the nils' do
89
+ january.send(method).map{|dt| dt.day }.should == days
90
+ end
91
+ end
92
+
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,184 @@
1
+ require 'spec_helper'
2
+
3
+ describe UsBankHolidays do
4
+ let(:sample_holidays) {
5
+ [
6
+ '2014-01-01', #New Year’s Day
7
+ '2014-01-20', #Birthday of Martin Luther King, Jr.
8
+ '2014-02-17', #Washington’s Birthday
9
+ '2014-05-26', #Memorial Day
10
+ '2014-07-04', #Independence Day
11
+ '2014-09-01', #Labor Day
12
+ '2014-10-13', #Columbus Day
13
+ '2014-11-11', #Veterans Day
14
+ '2014-11-27', #Thanksgiving Day
15
+ '2014-12-25', #Christmas Day
16
+
17
+ '2015-01-01', #New Year’s Day
18
+ '2015-01-19', #Birthday of Martin Luther King, Jr.
19
+ '2015-02-16', #Washington’s Birthday
20
+ '2015-05-25', #Memorial Day
21
+ '2015-07-03', #Independence Day
22
+ '2015-09-07', #Labor Day
23
+ '2015-10-12', #Columbus Day
24
+ '2015-11-11', #Veterans Day
25
+ '2015-11-26', #Thanksgiving Day
26
+ '2015-12-25', #Christmas Day
27
+
28
+ '2016-01-01', #New Year’s Day
29
+ '2016-01-18', #Birthday of Martin Luther King, Jr.
30
+ '2016-02-15', #Washington’s Birthday
31
+ '2016-05-30', #Memorial Day
32
+ '2016-07-04', #Independence Day
33
+ '2016-09-05', #Labor Day
34
+ '2016-10-10', #Columbus Day
35
+ '2016-11-11', #Veterans Day
36
+ '2016-11-24', #Thanksgiving Day
37
+ '2016-12-26', #Christmas Day
38
+
39
+ '2017-01-02', #New Year’s Day
40
+ '2017-01-16', #Birthday of Martin Luther King, Jr.
41
+ '2017-02-20', #Washington’s Birthday
42
+ '2017-05-29', #Memorial Day
43
+ '2017-07-04', #Independence Day
44
+ '2017-09-04', #Labor Day
45
+ '2017-10-09', #Columbus Day
46
+ '2017-11-10', #Veterans Day
47
+ '2017-11-23', #Thanksgiving Day
48
+ '2017-12-25', #Christmas Day
49
+
50
+ '2018-01-01', #New Year’s Day
51
+ '2018-01-15', #Birthday of Martin Luther King, Jr.
52
+ '2018-02-19', #Washington’s Birthday
53
+ '2018-05-28', #Memorial Day
54
+ '2018-07-04', #Independence Day
55
+ '2018-09-03', #Labor Day
56
+ '2018-10-08', #Columbus Day
57
+ '2018-11-12', #Veterans Day
58
+ '2018-11-22', #Thanksgiving Day
59
+ '2018-12-25', #Christmas Day
60
+
61
+ '2019-01-01', #New Year’s Day
62
+ '2019-01-21', #Birthday of Martin Luther King, Jr.
63
+ '2019-02-18', #Washington’s Birthday
64
+ '2019-05-27', #Memorial Day
65
+ '2019-07-04', #Independence Day
66
+ '2019-09-02', #Labor Day
67
+ '2019-10-14', #Columbus Day
68
+ '2019-11-11', #Veterans Day
69
+ '2019-11-28', #Thanksgiving Day
70
+ '2019-12-25', #Christmas Day
71
+
72
+ '2020-01-01', #New Year’s Day
73
+ '2020-01-20', #Birthday of Martin Luther King, Jr.
74
+ '2020-02-17', #Washington’s Birthday
75
+ '2020-05-25', #Memorial Day
76
+ '2020-07-03', #Independence Day
77
+ '2020-09-07', #Labor Day
78
+ '2020-10-12', #Columbus Day
79
+ '2020-11-11', #Veterans Day
80
+ '2020-11-26', #Thanksgiving Day
81
+ '2020-12-25' #Christmas Day
82
+ ].map {|date_str| Date.parse(date_str) }
83
+ }
84
+
85
+ let(:sample_weekends) { [Date.new(2014, 2, 1), Date.new(2014, 2, 2)] }
86
+
87
+ let(:sample_weekdays) { [3, 4, 5, 6, 7].map{|d| Date.new(2014, 2, d) } }
88
+
89
+ describe '.bank_holiday?' do
90
+ it 'should determine bank holidays on the list' do
91
+ sample_holidays.each{ |holiday| UsBankHolidays.bank_holiday?(holiday).should be_true }
92
+ end
93
+
94
+ it 'weekends should be bank holidays' do
95
+ sample_weekends.each{ |weekend| UsBankHolidays.bank_holiday?(weekend).should be_true }
96
+ end
97
+
98
+ it 'regular days should not be bank holidays' do
99
+ sample_weekdays.each { |day| UsBankHolidays.bank_holiday?(day).should be_false }
100
+ end
101
+ end
102
+
103
+ describe '.weekend?' do
104
+ it 'should recognize weekends' do
105
+ sample_weekends.each{ |weekend| UsBankHolidays.weekend?(weekend).should be_true }
106
+ end
107
+
108
+ it 'weekdays should not be considered weekends' do
109
+ sample_weekdays.each { |day| UsBankHolidays.weekend?(day).should be_false }
110
+ end
111
+ end
112
+
113
+ describe ::UsBankHolidays::DateMethods do
114
+
115
+ describe '.bank_holiday?' do
116
+
117
+ it 'should recognize bank holidays' do
118
+ sample_holidays.each{ |holiday| holiday.bank_holiday?.should be_true }
119
+ end
120
+
121
+ it 'should treat weekends as bank holidays' do
122
+ sample_weekends.each{ |weekend| weekend.bank_holiday?.should be_true }
123
+ end
124
+
125
+ it 'should not treat regular weekdays as bank holidays' do
126
+ sample_weekdays.each { |day| day.bank_holiday?.should be_false }
127
+ end
128
+
129
+ it 'if Jan. 1 falls on a Saturday, Dec. 31 of the previous year should be a bank holiday' do
130
+ Date.new(2021, 12, 31).bank_holiday?.should be_true
131
+ end
132
+ end
133
+
134
+ describe '.weekend?' do
135
+
136
+ it 'should recognize weekends' do
137
+ sample_weekends.each{ |weekend| weekend.weekend?.should be_true }
138
+ end
139
+
140
+ it 'weekdays should not be considered weekends' do
141
+ sample_weekdays.each { |day| day.weekend?.should be_false }
142
+ end
143
+
144
+ end
145
+
146
+ describe '.next_banking_day' do
147
+ it 'should determine the next banking day' do
148
+ Date.new(2014, 1, 1).next_banking_day.should == Date.new(2014, 1, 2)
149
+ Date.new(2014, 1, 2).next_banking_day.should == Date.new(2014, 1, 3)
150
+ Date.new(2014, 1, 3).next_banking_day.should == Date.new(2014, 1, 6)
151
+ Date.new(2014, 1, 4).next_banking_day.should == Date.new(2014, 1, 6)
152
+ Date.new(2014, 1, 5).next_banking_day.should == Date.new(2014, 1, 6)
153
+ end
154
+ end
155
+
156
+ describe '.previous_baking_day' do
157
+ it 'should determine the previous banking day' do
158
+ Date.new(2014, 1, 7).previous_banking_day.should == Date.new(2014, 1, 6)
159
+ Date.new(2014, 1, 6).previous_banking_day.should == Date.new(2014, 1, 3)
160
+ Date.new(2014, 1, 5).previous_banking_day.should == Date.new(2014, 1, 3)
161
+ Date.new(2014, 1, 4).previous_banking_day.should == Date.new(2014, 1, 3)
162
+ Date.new(2014, 1, 21).previous_banking_day.should == Date.new(2014, 1, 17)
163
+ end
164
+ end
165
+
166
+ describe '.add_banking_days' do
167
+ it 'should return self if given 0' do
168
+ Date.new(2014, 1, 7).add_banking_days(0).should == Date.new(2014, 1, 7)
169
+ end
170
+
171
+ it 'should return self if given 0 even if self is a bank holiday' do
172
+ Date.new(2014, 1, 4).add_banking_days(0).should == Date.new(2014, 1, 4)
173
+ end
174
+
175
+ it 'if given a positive number, should add banking days, ignoring bank holidays' do
176
+ Date.new(2014, 1, 16).add_banking_days(2).should == Date.new(2014, 1, 21)
177
+ end
178
+
179
+ it 'if given a negative number, should subtract banking days, ignoring bank holidays' do
180
+ Date.new(2014, 1, 21).add_banking_days(-2).should == Date.new(2014, 1, 16)
181
+ end
182
+ end
183
+ end
184
+ end
@@ -0,0 +1,16 @@
1
+ unless ENV['TRAVIS']
2
+ require 'simplecov'
3
+ SimpleCov.start
4
+ end
5
+
6
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'us_bank_holidays')
7
+
8
+ # This file was generated by the `rspec --init` command. Conventionally, all
9
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
10
+ # Require this file using `require "spec_helper"` to ensure that it is only
11
+ # loaded once.
12
+ #
13
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
14
+ RSpec.configure do |config|
15
+ config.fail_fast = true
16
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'us_bank_holidays/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "us_bank_holidays"
8
+ spec.version = UsBankHolidays::VERSION
9
+ spec.authors = ["Arthur Shagall"]
10
+ spec.email = ["arthur.shagall@gmail.com"]
11
+ spec.description = %q{Simplify working with US bank holidays.}
12
+ spec.summary = %q{Patches Date to add methods to make dealing with US bank holidays simpler.}
13
+ spec.homepage = "https://github.com/albertosaurus/us_bank_holidays"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/) - ['.gitignore', '.rvmrc', '.rspec']
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rspec'
24
+ spec.add_development_dependency 'simplecov'
25
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: us_bank_holidays
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Arthur Shagall
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '1.3'
25
+ prerelease: false
26
+ type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ prerelease: false
40
+ type: :development
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ prerelease: false
54
+ type: :development
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ prerelease: false
68
+ type: :development
69
+ description: Simplify working with US bank holidays.
70
+ email:
71
+ - arthur.shagall@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - Gemfile
77
+ - LICENSE.txt
78
+ - README.md
79
+ - Rakefile
80
+ - lib/us_bank_holidays.rb
81
+ - lib/us_bank_holidays/holiday_year.rb
82
+ - lib/us_bank_holidays/month.rb
83
+ - lib/us_bank_holidays/version.rb
84
+ - spec/functional/holiday_year_spec.rb
85
+ - spec/functional/month_spec.rb
86
+ - spec/functional/us_bank_holidays_spec.rb
87
+ - spec/spec_helper.rb
88
+ - us_bank_holidays.gemspec
89
+ homepage: https://github.com/albertosaurus/us_bank_holidays
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.2.1
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Patches Date to add methods to make dealing with US bank holidays simpler.
113
+ test_files:
114
+ - spec/functional/holiday_year_spec.rb
115
+ - spec/functional/month_spec.rb
116
+ - spec/functional/us_bank_holidays_spec.rb
117
+ - spec/spec_helper.rb