fiscali 2.4.3 → 2.4.4

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
- SHA1:
3
- metadata.gz: 4147bd764bf1f5688c196dc868493a058499ec09
4
- data.tar.gz: ba52f5ea40bde306a76aaa67d5290fff3dc7405c
2
+ SHA256:
3
+ metadata.gz: 81069ed1f2eb4751cf14a55df03ad0df6dabec33b87a22ab1b718c5eb09180a3
4
+ data.tar.gz: 50eb72e9af40e2d8974d6faca52291a448bcff138afa40331fd93e6425b1c64b
5
5
  SHA512:
6
- metadata.gz: e41fd5a92e55d3493bc329a7237c8030fc87f10203f4f427aeb2442299da2d8b1a3422bc65d74d42603e6b968a0580322c939aff963c9e7adaeae0138690da40
7
- data.tar.gz: 1463b2a377b8817a6c794201aea66a14515816089e316ab16c6a5bd175ceb07dac2e70f242f63d38a8146850f6d17b710e62a5083ff604d7b042d12de672f606
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
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ /.idea
@@ -1,3 +1,6 @@
1
1
  rvm:
2
+ - 2.4.1
3
+ - 2.3.4
4
+ - 2.2.7
2
5
  - 2.1.1
3
- - 2.0.0
6
+ - 2.0.0
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ v2.4.0 (Unreleased)
2
+ =======
3
+ * Add Add all_financial_quarter and all_financial_year to match ActiveSupport (thx @maxwell)
4
+ * Change financial_year_start to honor @fy_forward (thx @wubr)
5
+ * update CI + tests
6
+
1
7
  v2.3.0
2
8
  =======
3
9
 
@@ -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
 
@@ -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@me.com"]
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.3'
22
+ gem.add_development_dependency 'rspec', '~> 3.10'
23
23
  end
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module RisingSun
2
2
  module Fiscali
3
- VERSION = "2.4.3"
3
+ VERSION = "2.4.4"
4
4
  end
5
5
  end
@@ -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.3
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: 2016-03-10 00:00:00.000000000 Z
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.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.3'
54
+ version: '3.10'
55
55
  description: Fiscal Year Date Functions
56
56
  email:
57
- - asanghi@me.com
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
- rubyforge_project:
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