fiscali 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +22 -0
- data/.gitignore +1 -0
- data/.travis.yml +4 -1
- data/CHANGELOG +6 -0
- data/README.markdown +2 -0
- data/fiscali.gemspec +2 -2
- data/lib/rising_sun/fiscali.rb +9 -1
- data/lib/rising_sun/version.rb +1 -1
- data/spec/fiscali_spec.rb +23 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 81069ed1f2eb4751cf14a55df03ad0df6dabec33b87a22ab1b718c5eb09180a3
|
4
|
+
data.tar.gz: 50eb72e9af40e2d8974d6faca52291a448bcff138afa40331fd93e6425b1c64b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c099b90e42efbf2e0d3698c0370113a5cb17d22bb8bd8e35f710fb913f2396d431a90d6bcc275cd386395724d58fab093fe2d14ebc34273c5f2af47bc074c1d
|
7
|
+
data.tar.gz: 17c5627351ee9bca5d7998f6b820677972a5baa6b9f36530e3fd446c3e63138d9414d8fed01caab7e8a75ae3bc1b4d0086c2f8c438073f90b1854e9142002327
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: 'CI'
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request: ~
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
run-tests:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
rubyversion: ['2.5', '2.6', '2.7', '3.0']
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: set up ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.rubyversion }}
|
20
|
+
bundler-cache: true
|
21
|
+
- name: run tests
|
22
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -219,6 +219,8 @@ Since 1st Jan 2009 in India falls in the 2008-09 financial year
|
|
219
219
|
* [@chiperific](https://github.com/chiperific)
|
220
220
|
* [@rshallit](https://github.com/rshallit)
|
221
221
|
* [@asanghi](https://github.com/asanghi)
|
222
|
+
* [@maxwell](https://github.com/maxwell)
|
223
|
+
* [@wubr](https://github.com/wubr)
|
222
224
|
|
223
225
|
## License
|
224
226
|
|
data/fiscali.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.name = "fiscali"
|
6
6
|
gem.version = RisingSun::Fiscali::VERSION
|
7
7
|
gem.authors = ["Aditya Sanghi"]
|
8
|
-
gem.email = ["asanghi@
|
8
|
+
gem.email = ["asanghi@hey.com"]
|
9
9
|
gem.description = %q{Fiscal Year Date Functions}
|
10
10
|
gem.summary = %q{Fiscal Year Date Functions}
|
11
11
|
gem.homepage = "https://github.com/asanghi/fiscali"
|
@@ -19,5 +19,5 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_dependency 'activesupport'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'rake'
|
22
|
-
gem.add_development_dependency 'rspec', '~> 3.
|
22
|
+
gem.add_development_dependency 'rspec', '~> 3.10'
|
23
23
|
end
|
data/lib/rising_sun/fiscali.rb
CHANGED
@@ -29,7 +29,7 @@ module RisingSun
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def financial_year_start(year=Date.today.year)
|
32
|
-
new(year,fy_start_month,1)
|
32
|
+
uses_forward_year? ? new(year - 1,fy_start_month,1) : new(year,fy_start_month,1)
|
33
33
|
end
|
34
34
|
|
35
35
|
def financial_months
|
@@ -117,6 +117,14 @@ module RisingSun
|
|
117
117
|
beginning_of_financial_half.months_ago(6)
|
118
118
|
end
|
119
119
|
|
120
|
+
def all_financial_quarter
|
121
|
+
beginning_of_financial_quarter..end_of_financial_quarter
|
122
|
+
end
|
123
|
+
|
124
|
+
def all_financial_year
|
125
|
+
beginning_of_financial_year..end_of_financial_year
|
126
|
+
end
|
127
|
+
|
120
128
|
def financial_month_of(month)
|
121
129
|
if month < start_month
|
122
130
|
Date.new(year+1,month,1)
|
data/lib/rising_sun/version.rb
CHANGED
data/spec/fiscali_spec.rb
CHANGED
@@ -50,6 +50,15 @@ describe "fiscali" do
|
|
50
50
|
@d = Date.new(2009,6,1)
|
51
51
|
expect(@d.beginning_of_financial_year).to eql(Date.new(2009,4,1))
|
52
52
|
end
|
53
|
+
|
54
|
+
it "should report financial year start" do
|
55
|
+
Date.fiscal_zone = :india
|
56
|
+
Date.use_forward_year!
|
57
|
+
this_year = Date.today.year
|
58
|
+
expect(Date.financial_year_start).to eql(Date.new(this_year-1,4,1))
|
59
|
+
|
60
|
+
expect(Date.financial_year_start(2009)).to eql(Date.new(2008,4,1))
|
61
|
+
end
|
53
62
|
end
|
54
63
|
|
55
64
|
context "should report correct date field" do
|
@@ -205,4 +214,18 @@ describe "fiscali" do
|
|
205
214
|
end
|
206
215
|
end
|
207
216
|
end
|
217
|
+
|
218
|
+
context 'all_* methods' do
|
219
|
+
it 'returns a range of the entire financial period' do
|
220
|
+
date = Date.today
|
221
|
+
range = date.all_financial_quarter
|
222
|
+
expect(range.first).to eql(date.beginning_of_financial_quarter)
|
223
|
+
expect(range.last).to eql(date.end_of_financial_quarter)
|
224
|
+
|
225
|
+
range = date.all_financial_year
|
226
|
+
|
227
|
+
expect(range.first).to eql(date.beginning_of_financial_year)
|
228
|
+
expect(range.last).to eql(date.end_of_financial_year)
|
229
|
+
end
|
230
|
+
end
|
208
231
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fiscali
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditya Sanghi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,22 +44,23 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.10'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.10'
|
55
55
|
description: Fiscal Year Date Functions
|
56
56
|
email:
|
57
|
-
- asanghi@
|
57
|
+
- asanghi@hey.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".document"
|
63
|
+
- ".github/workflows/ci.yml"
|
63
64
|
- ".gitignore"
|
64
65
|
- ".travis.yml"
|
65
66
|
- CHANGELOG
|
@@ -93,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
- !ruby/object:Gem::Version
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
|
-
|
97
|
-
rubygems_version: 2.4.8
|
97
|
+
rubygems_version: 3.1.2
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Fiscal Year Date Functions
|