ae_bank_days 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06f9983d00ce48e33b4a934f726e456d1eb37daec1355aad31cf605f9c5ef0bd
4
- data.tar.gz: e3b17132d6696f57e38e2a1addac13d1ae4daa49fcb788dae5e553b66cec463f
3
+ metadata.gz: 36bfedfe987fca5f33d94432a975911c86c7059e5ebd8ed043c63e3ba1fb79d9
4
+ data.tar.gz: 97e533307630017923b3be98066497cc9f8ef839681ac0b556bf57aad03ea118
5
5
  SHA512:
6
- metadata.gz: f43ac398011e018ece5207f6db467339a3b9255451627cad5cd5e970b3d08512d38c3ae9d09604ddf09d177a30febdbf98d7e5e5ba6ef8329c9122aea7424e8b
7
- data.tar.gz: b0e66f75d0ea3c5ac6d39a7240e3a284af57968292e69a5b14dbfb1753273bc21a425ab9b67e0b8f5bcedffd8bc87a7d77cca0959b6944d0a3d75105087a4c00
6
+ metadata.gz: 5953980f703d5a2693692712d4d1b3ff4a4c6f4e5805c838447dc3dc4215fd74f56e975d47079fa4add65c41ac8d43c57820918d07ffede9f192f0d44f6e4717
7
+ data.tar.gz: 02dbe2927e5da4c4c1bb4f5b9159cefcaaabbccd608f0122aa8d8bd8e0a1d50f4181ac59f93cf21a40a11572c641176771af35c39ae7e9e00199597e18e1f76d
data/Gemfile CHANGED
@@ -1,5 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source 'https://rubygems.org' do
4
+ gem 'appraisal', '>= 2.3', '< 3'
5
+ gem 'bundler', '>= 1.10.4', '< 3'
6
+ gem 'minitest', '>= 5.8', '< 6'
7
+ gem 'minitest-reporters', '>= 1.4', '< 2'
8
+ gem 'mocha', '>= 1.11', '< 2'
9
+ gem 'rake', '>= 13', '< 14'
10
+ gem 'simplecov', '>= 0.18', '< 1', group: :test, require: false
11
+ end
4
12
 
5
13
  gemspec
@@ -1,8 +1,19 @@
1
- = ae_bank_days
1
+ # AeBankDays
2
2
 
3
3
  Simple utility to find the next banking day
4
4
 
5
- == Contributing to ae_bank_days
5
+ ## Running Tests
6
+
7
+ Use the appraisal gem to test different versions of Ruby to ensure changes are compatible. Run them with the
8
+ following command with the different versions of Ruby set:
9
+
10
+ `bundle exec appraisal rake test`
11
+
12
+ For a more detailed output that includes total coverage use:
13
+
14
+ `WITH_COVERAGE=true bundle exec rake test`
15
+
16
+ ## Contributing to AeBankDays
6
17
 
7
18
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
19
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
@@ -10,8 +21,5 @@ Simple utility to find the next banking day
10
21
  * Start a feature/bugfix branch.
11
22
  * Commit and push until you are happy with your contribution.
12
23
  * Make sure to add tests for it. This is important so it doesn't break in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so it can be cherry-picked around.
14
-
15
- == Copyright
16
-
17
- Copyright © 2019-2020 AppFolio.
24
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise
25
+ necessary, that is fine, but please isolate to its own commit so it can be cherry-picked around.
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems'
4
3
  require 'bundler'
5
4
 
6
5
  begin
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'ae_bank_days/version'
3
+ require_relative 'lib/ae_bank_days/version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'ae_bank_days'
@@ -12,20 +10,14 @@ Gem::Specification.new do |spec|
12
10
  spec.email = ['dev@appfolio.com']
13
11
  spec.summary = 'Gem for finding the next banking date'
14
12
  spec.description = spec.summary
15
- spec.homepage = 'http://github.com/appfolio/ae_bank_days'
16
- spec.required_ruby_version = ['>= 2.3.3', '< 2.7']
13
+ spec.homepage = 'https://github.com/appfolio/ae_bank_days'
14
+ spec.required_ruby_version = '>= 2.3.3'
17
15
  spec.licenses = ['MIT']
18
- spec.files = Dir['**/*'].reject { |f| f[%r{^log/}] || f[%r{^pkg/}] }
16
+ spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|Gemfile$|Rakefile|README.md|.*gemspec)}] }
19
17
  spec.test_files = spec.files.grep(%r{^(test)/})
20
18
  spec.require_paths = ['lib']
21
19
 
22
20
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
21
 
24
22
  spec.add_dependency('holidays', '~> 8.3')
25
-
26
- spec.add_development_dependency('bundler', ['>= 1.10.4', '< 3'])
27
- spec.add_development_dependency('minitest', '>= 5.8')
28
- spec.add_development_dependency('minitest-reporters', '>= 1.3')
29
- spec.add_development_dependency('mocha', '>= 1.1')
30
- spec.add_development_dependency('rake', '>= 12.0')
31
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AeBankDays
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_bank_days
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2020-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holidays
@@ -24,82 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '8.3'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.10.4
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '3'
37
- type: :development
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.10.4
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '3'
47
- - !ruby/object:Gem::Dependency
48
- name: minitest
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '5.8'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '5.8'
61
- - !ruby/object:Gem::Dependency
62
- name: minitest-reporters
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '1.3'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '1.3'
75
- - !ruby/object:Gem::Dependency
76
- name: mocha
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '1.1'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '1.1'
89
- - !ruby/object:Gem::Dependency
90
- name: rake
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '12.0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '12.0'
103
27
  description: Gem for finding the next banking date
104
28
  email:
105
29
  - dev@appfolio.com
@@ -108,20 +32,14 @@ extensions: []
108
32
  extra_rdoc_files: []
109
33
  files:
110
34
  - Gemfile
111
- - Gemfile.lock
112
- - LICENSE.txt
113
- - README.rdoc
35
+ - README.md
114
36
  - Rakefile
115
37
  - ae_bank_days.gemspec
116
38
  - lib/ae_bank_days.rb
117
39
  - lib/ae_bank_days/bank_day_helper.rb
118
40
  - lib/ae_bank_days/date_extensions.rb
119
41
  - lib/ae_bank_days/version.rb
120
- - test/ae_bank_days/bank_day_helper_test.rb
121
- - test/ae_bank_days/date_extensions_test.rb
122
- - test/ae_bank_days_test.rb
123
- - test/test_helper.rb
124
- homepage: http://github.com/appfolio/ae_bank_days
42
+ homepage: https://github.com/appfolio/ae_bank_days
125
43
  licenses:
126
44
  - MIT
127
45
  metadata:
@@ -135,21 +53,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
53
  - - ">="
136
54
  - !ruby/object:Gem::Version
137
55
  version: 2.3.3
138
- - - "<"
139
- - !ruby/object:Gem::Version
140
- version: '2.7'
141
56
  required_rubygems_version: !ruby/object:Gem::Requirement
142
57
  requirements:
143
58
  - - ">="
144
59
  - !ruby/object:Gem::Version
145
60
  version: '0'
146
61
  requirements: []
147
- rubygems_version: 3.0.3
62
+ rubygems_version: 3.1.2
148
63
  signing_key:
149
64
  specification_version: 4
150
65
  summary: Gem for finding the next banking date
151
- test_files:
152
- - test/ae_bank_days/bank_day_helper_test.rb
153
- - test/ae_bank_days/date_extensions_test.rb
154
- - test/ae_bank_days_test.rb
155
- - test/test_helper.rb
66
+ test_files: []
@@ -1,35 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- ae_bank_days (1.2.0)
5
- holidays (~> 8.3)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ansi (1.5.0)
11
- builder (3.2.4)
12
- holidays (8.3.0)
13
- minitest (5.11.3)
14
- minitest-reporters (1.3.0)
15
- ansi
16
- builder
17
- minitest (>= 5.0)
18
- ruby-progressbar
19
- mocha (1.11.2)
20
- rake (12.3.3)
21
- ruby-progressbar (1.10.1)
22
-
23
- PLATFORMS
24
- ruby
25
-
26
- DEPENDENCIES
27
- ae_bank_days!
28
- bundler (>= 1.10.4, < 3)
29
- minitest (>= 5.8)
30
- minitest-reporters (>= 1.3)
31
- mocha (>= 1.1)
32
- rake (>= 12.0)
33
-
34
- BUNDLED WITH
35
- 2.1.4
@@ -1,20 +0,0 @@
1
- Copyright (c) 2019-2020 AppFolio inc
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,75 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- module AeBankDays
6
- class BankDayHelperTest < Minitest::Test
7
- def test_bank_day__weekday
8
- assert BankDayHelper.bank_day?(Date.civil(2017, 10, 3))
9
- end
10
-
11
- def test_bank_day__weekend
12
- refute BankDayHelper.bank_day?(Date.civil(2017, 10, 14))
13
- end
14
-
15
- def test_bank_day__holiday
16
- refute BankDayHelper.bank_day?(Date.civil(2017, 10, 9))
17
- end
18
-
19
- def test_bank_day__saturday_holiday_is_not_observed_on_friday
20
- # The federal bank does not observe holidays that fall on Saturday on the preceding Friday as is common.
21
- # This test makes sure that these dates are not accidentally marked as holidays.
22
- # July 4, 2020 fell on a Saturday. The day before was a generally observed federal holiday, but it was still
23
- # a banking day due to the federal banks holiday rules.
24
- assert BankDayHelper.bank_day?(Date.civil(2020, 6, 3))
25
- end
26
-
27
- def test_next_banking_day__weekday
28
- assert_equal Date.civil(2017, 10, 3), BankDayHelper.next_banking_day(Date.civil(2017, 10, 3))
29
- end
30
-
31
- def test_next_banking_day__weekday__extra_days
32
- assert_equal Date.civil(2017, 10, 6), BankDayHelper.next_banking_day(Date.civil(2017, 10, 3), number_of_days: 3)
33
- end
34
-
35
- def test_next_banking_day__weekend
36
- assert_equal Date.civil(2017, 10, 16), BankDayHelper.next_banking_day(Date.civil(2017, 10, 14))
37
- end
38
-
39
- def test_next_banking_day__weekend__extra_days
40
- assert_equal Date.civil(2017, 10, 19), BankDayHelper.next_banking_day(Date.civil(2017, 10, 14), number_of_days: 3)
41
- end
42
-
43
- def test_next_banking_day__holiday
44
- assert_equal Date.civil(2017, 10, 10), BankDayHelper.next_banking_day(Date.civil(2017, 10, 9))
45
- end
46
-
47
- def test_next_banking_day__holiday__extra_days
48
- assert_equal Date.civil(2017, 10, 13), BankDayHelper.next_banking_day(Date.civil(2017, 10, 9), number_of_days: 3)
49
- end
50
-
51
- def test_previous_banking_day__weekday
52
- assert_equal Date.civil(2017, 10, 3), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 3))
53
- end
54
-
55
- def test_previous_banking_day__weekday__extra_days
56
- assert_equal Date.civil(2017, 10, 3), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 6), number_of_days: 3)
57
- end
58
-
59
- def test_previous_banking_day__weekend
60
- assert_equal Date.civil(2017, 10, 13), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 14))
61
- end
62
-
63
- def test_previous_banking_day__weekend__extra_days
64
- assert_equal Date.civil(2017, 10, 10), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 14), number_of_days: 3)
65
- end
66
-
67
- def test_previous_banking_day__holiday
68
- assert_equal Date.civil(2017, 10, 6), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 9))
69
- end
70
-
71
- def test_previous_banking_day__holiday__extra_days
72
- assert_equal Date.civil(2017, 10, 3), BankDayHelper.previous_banking_day(Date.civil(2017, 10, 9), number_of_days: 3)
73
- end
74
- end
75
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- module AeBankDays
6
- class DateExtensionsTest < Minitest::Test
7
- def test_bank_day
8
- date = Date.today
9
- BankDayHelper.expects(:bank_day?).with(date).returns(true)
10
-
11
- assert date.bank_day?
12
- end
13
-
14
- def test_next_banking_day
15
- date = Date.today
16
- new_date = date + 2
17
- BankDayHelper.expects(:next_banking_day).with(date, number_of_days: 2).returns(new_date)
18
-
19
- assert_equal new_date, date.next_banking_day(2)
20
- end
21
-
22
- def test_next_banking_day__default
23
- date = Date.today
24
- new_date = date + 2
25
- BankDayHelper.expects(:next_banking_day).with(date, number_of_days: 0).returns(new_date)
26
-
27
- assert_equal new_date, date.next_banking_day
28
- end
29
-
30
- def test_previous_banking_day
31
- date = Date.today
32
- new_date = date + 2
33
- BankDayHelper.expects(:previous_banking_day).with(date, number_of_days: 2).returns(new_date)
34
-
35
- assert_equal new_date, date.previous_banking_day(2)
36
- end
37
-
38
- def test_previous_banking_day__default
39
- date = Date.today
40
- new_date = date + 2
41
- BankDayHelper.expects(:previous_banking_day).with(date, number_of_days: 0).returns(new_date)
42
-
43
- assert_equal new_date, date.previous_banking_day
44
- end
45
- end
46
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- class AeBankDaysTest < Minitest::Test
6
- def test_that_it_has_a_version_number
7
- refute_nil ::AeBankDays::VERSION
8
- end
9
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
-
6
- begin
7
- Bundler.setup(:default, :development)
8
- rescue Bundler::BundlerError => e
9
- warn e.message
10
- warn 'Run `bundle install` to install missing gems'
11
- exit e.status_code
12
- end
13
-
14
- require 'ae_bank_days'
15
- require 'minitest/autorun'
16
- require 'minitest/reporters'
17
- require 'mocha/setup'
18
- require 'time'
19
-
20
- MiniTest::Reporters.use!